Refactor client config (#529)

* Refactor client config

* Fix server tests

* Fix lint
This commit is contained in:
Charles Bochet
2023-07-07 11:10:42 -07:00
committed by GitHub
parent 11d18cc269
commit 26b033abc9
38 changed files with 386 additions and 180 deletions

View File

@ -0,0 +1,18 @@
import { gql } from '@apollo/client';
export const GET_CLIENT_CONFIG = gql`
query GetClientConfig {
clientConfig {
authProviders {
google
password
}
demoMode
debugMode
telemetry {
enabled
anonymizationEnabled
}
}
}
`;

View File

@ -0,0 +1,8 @@
import { atom } from 'recoil';
import { AuthProviders } from '~/generated/graphql';
export const authProvidersState = atom<AuthProviders>({
key: 'authProvidersState',
default: { google: false, magicLink: false, password: true },
});

View File

@ -0,0 +1,6 @@
import { atom } from 'recoil';
export const isDebugModeState = atom<boolean>({
key: 'isDebugModeState',
default: false,
});

View File

@ -0,0 +1,6 @@
import { atom } from 'recoil';
export const isDemoModeState = atom<boolean>({
key: 'isDemoModeState',
default: false,
});

View File

@ -0,0 +1,8 @@
import { atom } from 'recoil';
import { Telemetry } from '~/generated/graphql';
export const telemetryState = atom<Telemetry>({
key: 'telemetryState',
default: { enabled: true, anonymizationEnabled: true },
});