From 1601c4f83c75bc98ec1084725f9b126e871024b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sarstr=C3=B6m?= Date: Tue, 23 Nov 2021 22:01:28 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20wip=20feagture=20toggle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/skolplattformen-sthlm/App.tsx | 1 + .../components/login.component.tsx | 48 +++++++------------ libs/api-skolplattformen/lib/features.ts | 3 +- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/apps/skolplattformen-sthlm/App.tsx b/apps/skolplattformen-sthlm/App.tsx index 30988d60..66f7f5c9 100644 --- a/apps/skolplattformen-sthlm/App.tsx +++ b/apps/skolplattformen-sthlm/App.tsx @@ -77,6 +77,7 @@ export default () => { const systemTheme = useColorScheme() const colorScheme = usingSystemTheme ? systemTheme : theme + // Crash //const api = ApiList.get(currentSchoolPlatform)! // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const api = ApiList.get('goteborg-hjarntorget')! diff --git a/apps/skolplattformen-sthlm/components/login.component.tsx b/apps/skolplattformen-sthlm/components/login.component.tsx index 8083d6f8..a7c8cbfc 100644 --- a/apps/skolplattformen-sthlm/components/login.component.tsx +++ b/apps/skolplattformen-sthlm/components/login.component.tsx @@ -42,6 +42,18 @@ const BankId = () => ( /> ) +interface Logins { + BANKID_SAME_DEVICE: number + BANKID_ANOTHER_DEVICE: number + TEST_USER: number +} + +const LoginMethods: Logins = { + BANKID_SAME_DEVICE: 0, + BANKID_ANOTHER_DEVICE: 2, + TEST_USER: 3, +} + export const Login = () => { const { api } = useApi() const [cancelLoginRequest, setCancelLoginRequest] = useState< @@ -68,14 +80,16 @@ export const Login = () => { const valid = Personnummer.valid(personalIdNumber) const loginMethods = [ + t('auth.bankid.OpenOnThisDevice'), t('auth.bankid.OpenOnAnotherDevice'), t('auth.loginAsTestUser'), ] - if (loginBankIdSameDevice) { - loginMethods.unshift(t('auth.bankid.OpenOnThisDevice')) - } + //if (loginBankIdSameDevice) { + // loginMethods.unshift(t('auth.bankid.OpenOnThisDevice')) + //} + // move this to a central location? const schoolPlatforms = [ { id: 'stockholm-skolplattformen', @@ -316,31 +330,3 @@ export const Login = () => { ) } - -const themedStyles = StyleService.create({ - backdrop: { - backgroundColor: 'rgba(0, 0, 0, 0.5)', - }, - loginForm: { - ...LayoutStyle.mainAxis.flexStart, - width: '100%', - }, - pnrInput: { minHeight: 70 }, - loginButtonGroup: { - minHeight: 45, - }, - loginButton: { ...LayoutStyle.flex.full }, - loginMethodButton: { width: 45 }, - modal: { - width: '90%', - }, - bankIdLoading: { margin: 10 }, - cancelButtonStyle: { marginTop: 15 }, - icon: { - width: 20, - height: 20, - }, - platformPicker: { - width: '100%', - }, -}) diff --git a/libs/api-skolplattformen/lib/features.ts b/libs/api-skolplattformen/lib/features.ts index cc657870..cc5e3173 100644 --- a/libs/api-skolplattformen/lib/features.ts +++ b/libs/api-skolplattformen/lib/features.ts @@ -1,5 +1,6 @@ import { Features } from '@skolplattformen/api' export const features: Features = { - LOGIN_BANK_ID_SAME_DEVICE: true + LOGIN_BANK_ID_SAME_DEVICE: true, + FOOD_MENU: true, } \ No newline at end of file