-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tone of navbar derived from current selected release type
- Loading branch information
Showing
7 changed files
with
49 additions
and
56 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
13 changes: 0 additions & 13 deletions
13
packages/sanity/src/core/releases/tool/components/BadgeIcon.tsx
This file was deleted.
Oops, something went wrong.
29 changes: 19 additions & 10 deletions
29
packages/sanity/src/core/releases/tool/components/ReleaseAvatar.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,24 +1,33 @@ | ||
import {DotIcon} from '@sanity/icons' | ||
import {Box, Text} from '@sanity/ui' | ||
import {type CSSProperties} from 'react' | ||
import {type BundleDocument} from 'sanity' | ||
|
||
import {getReleaseTone} from '../../util/getReleaseTone' | ||
import {VersionAvatar} from './VersionAvatar' | ||
|
||
export function ReleaseAvatar({ | ||
fontSize, | ||
padding, | ||
fontSize = 1, | ||
padding = 3, | ||
release, | ||
}: { | ||
fontSize?: number | ||
padding?: number | ||
release: BundleDocument | ||
release: Partial<BundleDocument> | ||
}) { | ||
const releaseTone = getReleaseTone(release) | ||
|
||
return ( | ||
<VersionAvatar | ||
fontSize={fontSize} | ||
padding={padding} | ||
icon={DotIcon} | ||
tone={getReleaseTone(release)} | ||
/> | ||
<Box flex="none" padding={padding} style={{borderRadius: 3}}> | ||
<Text size={fontSize}> | ||
<DotIcon | ||
data-testid={`release-avatar-${releaseTone}`} | ||
style={ | ||
{ | ||
'--card-icon-color': `var(--card-badge-${releaseTone}-icon-color)`, | ||
} as CSSProperties | ||
} | ||
/> | ||
</Text> | ||
</Box> | ||
) | ||
} |
24 changes: 0 additions & 24 deletions
24
packages/sanity/src/core/releases/tool/components/VersionAvatar.tsx
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