remove banner on mobile/tablet devices

This commit is contained in:
Amruth Pillai
2024-03-25 15:08:39 +01:00
parent 890875ad9d
commit f6c2ae7504
19 changed files with 726 additions and 798 deletions

View File

@ -12,13 +12,13 @@ import {
FormMessage,
Input,
} from "@reactive-resume/ui";
import { ControllerRenderProps, useForm } from "react-hook-form";
import { useCallback } from "react";
import { useForm } from "react-hook-form";
import { useDebounceValue } from "usehooks-ts";
import { z } from "zod";
import { SectionDialog } from "../sections/shared/section-dialog";
import { URLInput } from "../sections/shared/url-input";
import { useDebounceValue } from "usehooks-ts";
import { useCallback } from "react";
const formSchema = profileSchema;
@ -30,7 +30,7 @@ export const ProfilesDialog = () => {
resolver: zodResolver(formSchema),
});
const [iconSrc, setIconSrc] = useDebounceValue("", 400)
const [iconSrc, setIconSrc] = useDebounceValue("", 400);
const handleIconChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
if (event.target.value === "") {
@ -40,8 +40,6 @@ export const ProfilesDialog = () => {
}
}, []);
return (
<SectionDialog<FormValues> id="profiles" form={form} defaultValues={defaultProfile}>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
@ -97,17 +95,17 @@ export const ProfilesDialog = () => {
<FormControl>
<div className="flex items-center gap-x-2">
<Avatar className="size-8 bg-white">
{iconSrc && (
<AvatarImage
className="p-1.5"
src={iconSrc}
/>
)}
{iconSrc && <AvatarImage className="p-1.5" src={iconSrc} />}
</Avatar>
<Input {...field} id="iconSlug" placeholder="linkedin" onChange={(event) => {
field.onChange(event)
handleIconChange(event)
}} />
<Input
{...field}
id="iconSlug"
placeholder="linkedin"
onChange={(event) => {
field.onChange(event);
handleIconChange(event);
}}
/>
</div>
</FormControl>
<FormMessage />