-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bottle): fallback ui when there is no bottle
- Loading branch information
Showing
18 changed files
with
125 additions
and
58 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
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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import NextImage, { ImageProps as NextImageProps } from 'next/image'; | ||
|
||
export function Image(props: Omit<NextImageProps, 'width' | 'height' | 'className'>) { | ||
return <NextImage {...props} width={180} height={180} />; | ||
} |
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,10 @@ | ||
import { Paragraph, spacings } from '@bottlesteam/ui'; | ||
import type { ReactNode } from 'react'; | ||
|
||
export function Subtitle({ children }: { children: ReactNode }) { | ||
return ( | ||
<Paragraph style={{ marginTop: spacings.xs }} color="neutral600" typography="bo"> | ||
{children} | ||
</Paragraph> | ||
); | ||
} |
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,10 @@ | ||
import { Paragraph, spacings } from '@bottlesteam/ui'; | ||
import type { ReactNode } from 'react'; | ||
|
||
export function Title({ children }: { children: ReactNode }) { | ||
return ( | ||
<Paragraph typography="st1" style={{ marginTop: spacings.xl }}> | ||
{children} | ||
</Paragraph> | ||
); | ||
} |
9 changes: 9 additions & 0 deletions
9
apps/bottle/src/components/common/fallback/fallbackStyle.css.ts
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,9 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const fallbackContainerStyle = style({ | ||
width: '100%', | ||
height: 'auto', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}); |
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,24 @@ | ||
import type { ReactNode } from 'react'; | ||
import { Image } from './Image'; | ||
import { Subtitle } from './Subtitle'; | ||
import { Title } from './Title'; | ||
import { fallbackContainerStyle } from './fallbackStyle.css'; | ||
|
||
interface FallbackProps { | ||
marginTop?: number; | ||
children: ReactNode; | ||
} | ||
|
||
function FallbackContainer({ children, marginTop = 0 }: FallbackProps) { | ||
return ( | ||
<section style={{ marginTop }} className={fallbackContainerStyle}> | ||
{children} | ||
</section> | ||
); | ||
} | ||
|
||
export const Fallback = Object.assign(FallbackContainer, { | ||
Image, | ||
Title, | ||
Subtitle, | ||
}); |
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