Skip to content

Commit

Permalink
Remove light theme
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Aug 26, 2024
1 parent 59ee626 commit 4eeceed
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 204 deletions.
6 changes: 0 additions & 6 deletions centrifuge-app/src/components/DebugFlags/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export type Key =
| 'persistDebugFlags'
| 'showUnusedFlags'
| 'allowInvestBelowMin'
| 'alternativeTheme'
| 'editPoolConfig'
| 'editPoolVisibility'
| 'showAdvancedAccounts'
Expand All @@ -59,11 +58,6 @@ export const flagsConfig = {
default: false,
type: 'checkbox',
},
alternativeTheme: {
alwaysShow: true,
default: false,
type: 'checkbox',
},
convertAddress: {
Component: ConvertAddressDialogWithButton,
alwaysShow: true,
Expand Down
4 changes: 2 additions & 2 deletions centrifuge-app/src/components/Menu/IssuerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ export function IssuerMenu({ defaultOpen = false, children }: IssuerMenuProps) {
id={`${id}-menu`}
aria-labelledby={`${id}-button`}
aria-expanded={!!open}
position={['absolute', 'absolute', 'absolute', 'static']}
position={['absolute', 'absolute', 'absolute', 'relative', 'static']}
top={['auto', 'auto', 0, 'auto']}
bottom={[offset, offset, 'auto']}
left={[1, 1, offset, offset, 'auto']}
width={[fullWidth, fullWidth, 200, '100%']}
mt={[0, 0, 0, 1]}
zIndex={10}
zIndex={20}
>
{isLarge ? (
<Stack as="ul" gap={1}>
Expand Down
12 changes: 2 additions & 10 deletions centrifuge-app/src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const router = createHashRouter([
{ path: '/nav-management/:pid', element: <NavManagementPage />, handle: { component: NavManagementPage } },
{ path: '*', element: <NotFoundPage />, handle: { component: NotFoundPage } },
],
errorElement: <NotFoundPage />,
},
])

Expand All @@ -169,23 +170,14 @@ export function prefetchRoute(to: string | NavLinkProps['to']) {

export function Root() {
const [debugState, setDebugState] = React.useState(initialFlagsState)
const isThemeToggled = debugState.alternativeTheme

return (
<>
<HelmetProvider>
<Head />
</HelmetProvider>
<QueryClientProvider client={queryClient}>
<FabricProvider
theme={
!isThemeToggled
? config.themes[config.defaultTheme]
: config.defaultTheme === 'dark'
? config.themes.light
: config.themes.dark
}
>
<FabricProvider theme={config.themes.light}>
<GlobalStyle />
<FabricGlobalStyle />
<CentrifugeProvider config={centConfig}>
Expand Down
33 changes: 3 additions & 30 deletions centrifuge-app/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TransactionOptions } from '@centrifuge/centrifuge-js'
import { EvmChains } from '@centrifuge/centrifuge-react'
import { altairDark, centrifugeLight } from '@centrifuge/fabric'
import { centrifugeLight } from '@centrifuge/fabric'
import arbitrumLogo from '@centrifuge/fabric/assets/logos/arbitrum.svg'
import assetHubLogo from '@centrifuge/fabric/assets/logos/assethub.svg'
import baseLogo from '@centrifuge/fabric/assets/logos/base.svg'
Expand Down Expand Up @@ -42,35 +42,12 @@ const lightTheme: DefaultTheme = {
},
},
}
const darkTheme: DefaultTheme = {
...altairDark,
sizes: {
...altairDark.sizes,
mainContent: 1800,
},
colors: {
...altairDark.colors,
placeholderBackground: altairDark.colors.backgroundSecondary,
},
typography: {
...altairDark.typography,
headingLarge: {
fontSize: [24, 24, 36],
lineHeight: 1.25,
fontWeight: 600,
color: 'textPrimary',
},
},
}

type EnvironmentConfig = {
name: string
logo: React.ComponentType<any>[]
network: 'altair' | 'centrifuge'
themes: {
light: DefaultTheme
dark: DefaultTheme
}
themes: { light: DefaultTheme }
defaultTheme: 'light' | 'dark'
baseCurrency: 'USD'
assetClasses: Record<'Public credit' | 'Private credit', string[]>
Expand All @@ -86,10 +63,7 @@ const ALTAIR: EnvironmentConfig = {
name: 'Pools on Altair',
logo: [LogoAltair, LogoAltairText],
network: 'altair',
themes: {
light: lightTheme,
dark: darkTheme,
},
themes: { light: lightTheme },
defaultTheme: 'dark',
baseCurrency: 'USD',
assetClasses: { 'Private credit': ['Art NFTs'], 'Public credit': [] },
Expand All @@ -102,7 +76,6 @@ const CENTRIFUGE: EnvironmentConfig = {
network: 'centrifuge',
themes: {
light: lightTheme,
dark: darkTheme,
},
defaultTheme: 'light',
baseCurrency: 'USD',
Expand Down
4 changes: 2 additions & 2 deletions fabric/src/theme/altairLight.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { baseTheme } from './tokens/baseTheme'
import { brandAltair } from './tokens/brandAltair'
import { blueScale, grayScale, yellowScale } from './tokens/colors'
import { modeLight } from './tokens/modeLight'
import { colorTheme } from './tokens/theme'
import { FabricTheme } from './types'

export const altairLight: FabricTheme = {
...baseTheme,
scheme: 'light',
colors: {
...brandAltair,
...modeLight.colors,
...colorTheme.colors,
primarySelectedBackground: blueScale[500],
secondarySelectedBackground: blueScale[50],
focus: blueScale[500],
Expand Down
36 changes: 0 additions & 36 deletions fabric/src/theme/centrifugeDark.ts

This file was deleted.

4 changes: 2 additions & 2 deletions fabric/src/theme/centrifugeLight.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { baseTheme } from './tokens/baseTheme'
import { brandCentrifuge } from './tokens/brandCentrifuge'
import { blueScale, grayScale, yellowScale } from './tokens/colors'
import { modeLight } from './tokens/modeLight'
import { colorTheme } from './tokens/theme'
import { FabricTheme } from './types'

export const centrifugeLight: FabricTheme = {
...baseTheme,
scheme: 'light',
colors: {
...brandCentrifuge,
...modeLight.colors,
...colorTheme.colors,
primarySelectedBackground: blueScale[500],
secondarySelectedBackground: blueScale[50],
focus: blueScale[500],
Expand Down
1 change: 0 additions & 1 deletion fabric/src/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './altairDark'
export * from './altairLight'
export * from './centrifugeDark'
export * from './centrifugeLight'
export * from './types'
112 changes: 0 additions & 112 deletions fabric/src/theme/tokens/modeDark.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const statusPromoteBg = '#f8107114'
const black = '#252B34'
const gold = '#FFC500'

const lightColors = {
const colors = {
textPrimary: grayScale[900],
textSecondary: grayScale[800],
textDisabled: grayScale[500],
Expand Down Expand Up @@ -120,6 +120,6 @@ const lightColors = {
shadowButtonInverted: '#E0E7FF',
}

export const modeLight = {
colors: lightColors,
export const colorTheme = {
colors,
}

0 comments on commit 4eeceed

Please sign in to comment.