-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3705d8
commit 4efa9d6
Showing
5 changed files
with
57 additions
and
68 deletions.
There are no files selected for viewing
55 changes: 27 additions & 28 deletions
55
apps/mobile/src/components/GalleryEditor/GalleryEditorHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,39 @@ | ||
import { View } from 'react-native'; | ||
import { graphql, useFragment } from 'react-relay'; | ||
import { TextInput, View } from 'react-native'; | ||
|
||
import { GalleryEditorHeaderFragment$key } from '~/generated/GalleryEditorHeaderFragment.graphql'; | ||
import { useGalleryEditorActions } from '~/contexts/GalleryEditor/GalleryEditorContext'; | ||
|
||
import { BaseM } from '../Text'; | ||
import { Typography } from '../Typography'; | ||
|
||
type Props = { | ||
galleryRef: GalleryEditorHeaderFragment$key; | ||
}; | ||
|
||
export function GalleryEditorHeader({ galleryRef }: Props) { | ||
const gallery = useFragment( | ||
graphql` | ||
fragment GalleryEditorHeaderFragment on Gallery { | ||
name | ||
description | ||
} | ||
`, | ||
galleryRef | ||
); | ||
export function GalleryEditorHeader() { | ||
const { galleryName, setGalleryName, galleryDescription, setGalleryDescription } = | ||
useGalleryEditorActions(); | ||
|
||
return ( | ||
<View className="p-4 flex flex-col gap-4"> | ||
<Typography | ||
font={{ | ||
family: 'GTAlpina', | ||
weight: 'Light', | ||
}} | ||
className="text-[32px] leading-[36px] text-black-900 dark:text-white" | ||
<TextInput | ||
className="text-[32px] leading-[36px] text-metal dark:text-white" | ||
onChangeText={setGalleryName} | ||
placeholder="My Gallery" | ||
> | ||
<Typography | ||
font={{ | ||
family: 'GTAlpina', | ||
weight: 'Light', | ||
}} | ||
className="text-[32px] leading-[36px]text-black-900 dark:text-white" | ||
> | ||
{galleryName} | ||
</Typography> | ||
</TextInput> | ||
<TextInput | ||
onChangeText={setGalleryDescription} | ||
placeholder="Add an optional description...." | ||
className="text-metal" | ||
multiline | ||
> | ||
{gallery.name ?? 'My Gallery'} | ||
</Typography> | ||
<BaseM classNameOverride="text-metal"> | ||
{gallery.description || 'Add an optional description....'} | ||
</BaseM> | ||
<BaseM classNameOverride="text-metal leading-1">{galleryDescription}</BaseM> | ||
</TextInput> | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters