forked from bluesky-social/social-app
-
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.
Merge branch 'bluesky-social:main' into main
- Loading branch information
Showing
77 changed files
with
1,273 additions
and
327 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {useMemo} from 'react' | ||
import {useMediaQuery} from 'react-responsive' | ||
|
||
export type Breakpoint = 'gtPhone' | 'gtMobile' | 'gtTablet' | ||
|
||
export function useBreakpoints(): Record<Breakpoint, boolean> & { | ||
activeBreakpoint: Breakpoint | undefined | ||
} { | ||
const gtPhone = useMediaQuery({minWidth: 500}) | ||
const gtMobile = useMediaQuery({minWidth: 800}) | ||
const gtTablet = useMediaQuery({minWidth: 1300}) | ||
return useMemo(() => { | ||
let active: Breakpoint | undefined | ||
if (gtTablet) { | ||
active = 'gtTablet' | ||
} else if (gtMobile) { | ||
active = 'gtMobile' | ||
} else if (gtPhone) { | ||
active = 'gtPhone' | ||
} | ||
return { | ||
activeBreakpoint: active, | ||
gtPhone, | ||
gtMobile, | ||
gtTablet, | ||
} | ||
}, [gtPhone, gtMobile, gtTablet]) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React from 'react' | ||
|
||
import {Breakpoint, useBreakpoints} from '#/alf/breakpoints' | ||
import * as tokens from '#/alf/tokens' | ||
|
||
type Gutter = 'compact' | 'base' | 'wide' | 0 | ||
|
||
const gutters: Record< | ||
Exclude<Gutter, 0>, | ||
Record<Breakpoint | 'default', number> | ||
> = { | ||
compact: { | ||
default: tokens.space.sm, | ||
gtPhone: tokens.space.sm, | ||
gtMobile: tokens.space.md, | ||
gtTablet: tokens.space.md, | ||
}, | ||
base: { | ||
default: tokens.space.lg, | ||
gtPhone: tokens.space.lg, | ||
gtMobile: tokens.space.xl, | ||
gtTablet: tokens.space.xl, | ||
}, | ||
wide: { | ||
default: tokens.space.xl, | ||
gtPhone: tokens.space.xl, | ||
gtMobile: tokens.space._3xl, | ||
gtTablet: tokens.space._3xl, | ||
}, | ||
} | ||
|
||
type Gutters = { | ||
paddingTop: number | ||
paddingRight: number | ||
paddingBottom: number | ||
paddingLeft: number | ||
} | ||
|
||
export function useGutters([all]: [Gutter]): Gutters | ||
export function useGutters([vertical, horizontal]: [Gutter, Gutter]): Gutters | ||
export function useGutters([top, right, bottom, left]: [ | ||
Gutter, | ||
Gutter, | ||
Gutter, | ||
Gutter, | ||
]): Gutters | ||
export function useGutters([top, right, bottom, left]: Gutter[]) { | ||
const {activeBreakpoint} = useBreakpoints() | ||
if (right === undefined) { | ||
right = bottom = left = top | ||
} else if (bottom === undefined) { | ||
bottom = top | ||
left = right | ||
} | ||
return React.useMemo(() => { | ||
return { | ||
paddingTop: top === 0 ? 0 : gutters[top][activeBreakpoint || 'default'], | ||
paddingRight: | ||
right === 0 ? 0 : gutters[right][activeBreakpoint || 'default'], | ||
paddingBottom: | ||
bottom === 0 ? 0 : gutters[bottom][activeBreakpoint || 'default'], | ||
paddingLeft: | ||
left === 0 ? 0 : gutters[left][activeBreakpoint || 'default'], | ||
} | ||
}, [activeBreakpoint, top, right, bottom, left]) | ||
} |
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
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
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
Oops, something went wrong.