Skip to content

Commit

Permalink
feat: 🎸 wip feagture toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorlarsson committed Nov 23, 2021
1 parent 1caed91 commit 1601c4f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 32 deletions.
1 change: 1 addition & 0 deletions apps/skolplattformen-sthlm/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')!
Expand Down
48 changes: 17 additions & 31 deletions apps/skolplattformen-sthlm/components/login.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand All @@ -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',
Expand Down Expand Up @@ -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%',
},
})
3 changes: 2 additions & 1 deletion libs/api-skolplattformen/lib/features.ts
Original file line number Diff line number Diff line change
@@ -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,
}

0 comments on commit 1601c4f

Please sign in to comment.