Add Sunlight and Twilight color options to the Invite Friends QR code
This commit is contained in:
@@ -1304,7 +1304,7 @@ export type Events = {
|
|||||||
'invite:action:scan': {}
|
'invite:action:scan': {}
|
||||||
// user changed the QR card color theme
|
// user changed the QR card color theme
|
||||||
'invite:theme:change': {
|
'invite:theme:change': {
|
||||||
themeKey: 'dawn' | 'day' | 'dusk' | 'night'
|
themeKey: 'dawn' | 'sunlight' | 'day' | 'dusk' | 'twilight' | 'night'
|
||||||
}
|
}
|
||||||
// QR scanner decoded a code; result indicates whether it resolved to a profile
|
// QR scanner decoded a code; result indicates whether it resolved to a profile
|
||||||
'invite:scanner:scanned': {
|
'invite:scanner:scanned': {
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ export function ThemePicker({
|
|||||||
|
|
||||||
const labels: Record<InviteThemeKey, string> = {
|
const labels: Record<InviteThemeKey, string> = {
|
||||||
dawn: l`Dawn`,
|
dawn: l`Dawn`,
|
||||||
|
sunlight: l`Sunlight`,
|
||||||
day: l`Day`,
|
day: l`Day`,
|
||||||
dusk: l`Dusk`,
|
dusk: l`Dusk`,
|
||||||
|
twilight: l`Twilight`,
|
||||||
night: l`Night`,
|
night: l`Night`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,15 @@ import {describe, expect, it} from '@jest/globals'
|
|||||||
import {getInviteTheme, INVITE_THEME_KEYS, INVITE_THEMES} from './themes'
|
import {getInviteTheme, INVITE_THEME_KEYS, INVITE_THEMES} from './themes'
|
||||||
|
|
||||||
describe('invite themes', () => {
|
describe('invite themes', () => {
|
||||||
it('exposes four themes in canonical order', () => {
|
it('exposes six themes in canonical order', () => {
|
||||||
expect(INVITE_THEME_KEYS).toEqual(['dawn', 'day', 'dusk', 'night'])
|
expect(INVITE_THEME_KEYS).toEqual([
|
||||||
|
'dawn',
|
||||||
|
'sunlight',
|
||||||
|
'day',
|
||||||
|
'dusk',
|
||||||
|
'twilight',
|
||||||
|
'night',
|
||||||
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('has light and dark variants for every theme', () => {
|
it('has light and dark variants for every theme', () => {
|
||||||
|
|||||||
@@ -5,7 +5,13 @@
|
|||||||
* matching primary color; the QR data uses qrPrimary; the avatar handle text
|
* matching primary color; the QR data uses qrPrimary; the avatar handle text
|
||||||
* follows handleColor.
|
* follows handleColor.
|
||||||
*/
|
*/
|
||||||
export type InviteThemeKey = 'dawn' | 'day' | 'dusk' | 'night'
|
export type InviteThemeKey =
|
||||||
|
| 'dawn'
|
||||||
|
| 'sunlight'
|
||||||
|
| 'day'
|
||||||
|
| 'dusk'
|
||||||
|
| 'twilight'
|
||||||
|
| 'night'
|
||||||
|
|
||||||
export type InviteThemeVariant = {
|
export type InviteThemeVariant = {
|
||||||
/** QR data + eye color */
|
/** QR data + eye color */
|
||||||
@@ -30,8 +36,10 @@ export type InviteTheme = {
|
|||||||
|
|
||||||
export const INVITE_THEME_KEYS: readonly InviteThemeKey[] = [
|
export const INVITE_THEME_KEYS: readonly InviteThemeKey[] = [
|
||||||
'dawn',
|
'dawn',
|
||||||
|
'sunlight',
|
||||||
'day',
|
'day',
|
||||||
'dusk',
|
'dusk',
|
||||||
|
'twilight',
|
||||||
'night',
|
'night',
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
@@ -54,6 +62,24 @@ export const INVITE_THEMES: Record<InviteThemeKey, InviteTheme> = {
|
|||||||
handleColor: '#ffffff',
|
handleColor: '#ffffff',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
sunlight: {
|
||||||
|
key: 'sunlight',
|
||||||
|
swatch: '#ff8159',
|
||||||
|
light: {
|
||||||
|
qrPrimary: '#ff8159',
|
||||||
|
gradientFrom: '#ffc785',
|
||||||
|
gradientTo: '#ff8159',
|
||||||
|
shadowColor: '#ff8159',
|
||||||
|
handleColor: '#ffffff',
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
qrPrimary: '#ff8159',
|
||||||
|
gradientFrom: '#ffc785',
|
||||||
|
gradientTo: '#ff8159',
|
||||||
|
shadowColor: '#ff8159',
|
||||||
|
handleColor: '#ffffff',
|
||||||
|
},
|
||||||
|
},
|
||||||
day: {
|
day: {
|
||||||
key: 'day',
|
key: 'day',
|
||||||
swatch: '#006aff',
|
swatch: '#006aff',
|
||||||
@@ -90,6 +116,24 @@ export const INVITE_THEMES: Record<InviteThemeKey, InviteTheme> = {
|
|||||||
handleColor: '#ffffff',
|
handleColor: '#ffffff',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
twilight: {
|
||||||
|
key: 'twilight',
|
||||||
|
swatch: '#8b60f7',
|
||||||
|
light: {
|
||||||
|
qrPrimary: '#8b60f7',
|
||||||
|
gradientFrom: '#8ec1ff',
|
||||||
|
gradientTo: '#8b60f7',
|
||||||
|
shadowColor: '#8b60f7',
|
||||||
|
handleColor: '#ffffff',
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
qrPrimary: '#8b60f7',
|
||||||
|
gradientFrom: '#8ec1ff',
|
||||||
|
gradientTo: '#8b60f7',
|
||||||
|
shadowColor: '#8b60f7',
|
||||||
|
handleColor: '#ffffff',
|
||||||
|
},
|
||||||
|
},
|
||||||
night: {
|
night: {
|
||||||
key: 'night',
|
key: 'night',
|
||||||
swatch: '#0048ad',
|
swatch: '#0048ad',
|
||||||
|
|||||||
Reference in New Issue
Block a user