-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
profile settings and image editor - WIP
- Loading branch information
Showing
4 changed files
with
194 additions
and
34 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
import { DefaultReset, color, config } from 'folds'; | ||
|
||
export const ImageEditor = style([ | ||
DefaultReset, | ||
{ | ||
height: '100%', | ||
}, | ||
]); | ||
|
||
export const ImageEditorHeader = style([ | ||
DefaultReset, | ||
{ | ||
paddingLeft: config.space.S200, | ||
paddingRight: config.space.S200, | ||
borderBottomWidth: config.borderWidth.B300, | ||
flexShrink: 0, | ||
gap: config.space.S200, | ||
}, | ||
]); | ||
|
||
export const ImageEditorContent = style([ | ||
DefaultReset, | ||
{ | ||
backgroundColor: color.Background.Container, | ||
color: color.Background.OnContainer, | ||
overflow: 'hidden', | ||
}, | ||
]); | ||
|
||
export const Image = style({ | ||
width: '100%', | ||
height: '100%', | ||
objectFit: 'contain', | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import { Box, Chip, Header, Icon, IconButton, Icons, Text, as } from 'folds'; | ||
import * as css from './ImageEditor.css'; | ||
|
||
export type ImageEditorProps = { | ||
name: string; | ||
url: string; | ||
requestClose: () => void; | ||
}; | ||
|
||
export const ImageEditor = as<'div', ImageEditorProps>( | ||
({ className, name, url, requestClose, ...props }, ref) => { | ||
const handleApply = () => { | ||
// | ||
}; | ||
|
||
return ( | ||
<Box | ||
className={classNames(css.ImageEditor, className)} | ||
direction="Column" | ||
{...props} | ||
ref={ref} | ||
> | ||
<Header className={css.ImageEditorHeader} size="400"> | ||
<Box grow="Yes" alignItems="Center" gap="200"> | ||
<IconButton size="300" radii="300" onClick={requestClose}> | ||
<Icon size="50" src={Icons.ArrowLeft} /> | ||
</IconButton> | ||
<Text size="T300" truncate> | ||
Image Editor | ||
</Text> | ||
</Box> | ||
<Box shrink="No" alignItems="Center" gap="200"> | ||
<Chip variant="Primary" radii="300" onClick={handleApply}> | ||
<Text size="B300">Save</Text> | ||
</Chip> | ||
</Box> | ||
</Header> | ||
<Box | ||
grow="Yes" | ||
className={css.ImageEditorContent} | ||
justifyContent="Center" | ||
alignItems="Center" | ||
> | ||
<img className={css.Image} src={url} alt={name} /> | ||
</Box> | ||
</Box> | ||
); | ||
} | ||
); |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ImageEditor'; |
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