chore(cleaned up code)
Co-authored-by: Sebastian Palmqvist <PalmN72@users.noreply.github.com>
This commit is contained in:
parent
1988bb8e14
commit
43c83a6064
|
@ -17,7 +17,7 @@ import { View } from 'react-native'
|
|||
import DateTimePickerModal from 'react-native-modal-datetime-picker'
|
||||
import * as Yup from 'yup'
|
||||
import { defaultStackStyling } from '../design/navigationThemes'
|
||||
// import usePersonalStorage from '../hooks/usePersonalStorage';
|
||||
import usePersonalStorage from '../hooks/usePersonalStorage'
|
||||
import useSettingsStorage from '../hooks/useSettingsStorage'
|
||||
import { Layout as LayoutStyle, Sizing, Typography } from '../styles'
|
||||
import { studentName } from '../utils/peopleHelpers'
|
||||
|
|
|
@ -52,7 +52,6 @@ export const Auth: React.FC<AuthProps> = ({ navigation }) => {
|
|||
const styles = useStyleSheet(themeStyles)
|
||||
const colors = useTheme()
|
||||
const { t } = useTranslation()
|
||||
// const t = (key: string) => key;
|
||||
|
||||
return (
|
||||
<SafeAreaView>
|
||||
|
@ -68,7 +67,7 @@ export const Auth: React.FC<AuthProps> = ({ navigation }) => {
|
|||
accessibilityLabel={t(
|
||||
'auth.a11y_settings'
|
||||
// {
|
||||
// // defaultValue: 'Inställningar',
|
||||
// defaultValue: 'Inställningar',
|
||||
// }
|
||||
)}
|
||||
>
|
||||
|
|
|
@ -12,15 +12,12 @@ import moment from 'moment'
|
|||
import React from 'react'
|
||||
import { Layout as LayoutStyle, Sizing, Typography } from '../styles'
|
||||
import { ListRenderItemInfo, RefreshControl, View } from 'react-native'
|
||||
|
||||
import { translate } from '../utils/translation'
|
||||
import { useChild } from './childContext.component'
|
||||
import { CalendarOutlineIcon } from './icon.component'
|
||||
import { SaveToCalendar } from './saveToCalendar.component'
|
||||
import { Week } from './week.component'
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
export const Calendar = () => {
|
||||
const child = useChild()
|
||||
const { data, status, reload } = useCalendar(child)
|
||||
|
|
|
@ -6,10 +6,10 @@ import {
|
|||
useRoute,
|
||||
} from '@react-navigation/native'
|
||||
import { NativeStackNavigationOptions } from '@react-navigation/native-stack'
|
||||
// import {StackNavigationProp} from '@react-navigation/stack';
|
||||
import { StackNavigationProp } from '@react-navigation/stack'
|
||||
import { Icon } from '@ui-kitten/components'
|
||||
import React, { useEffect } from 'react'
|
||||
// import {StyleProp, TextProps} from 'react-native';
|
||||
import { StyleProp, TextProps } from 'react-native'
|
||||
import { defaultStackStyling } from '../design/navigationThemes'
|
||||
import { useFeature } from '../hooks/useFeature'
|
||||
import { studentName } from '../utils/peopleHelpers'
|
||||
|
@ -24,9 +24,7 @@ import { NewsList } from './newsList.component'
|
|||
import { NotificationsList } from './notificationsList.component'
|
||||
import { TabBarLabel } from './tabBarLabel.component'
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
// type ChildNavigationProp = StackNavigationProp<RootStackParamList, 'Child'>;
|
||||
type ChildNavigationProp = StackNavigationProp<RootStackParamList, 'Child'>
|
||||
type ChildRouteProps = RouteProp<RootStackParamList, 'Child'>
|
||||
|
||||
export type ChildTabParamList = {
|
||||
|
|
|
@ -15,8 +15,6 @@ import { translate } from '../utils/translation'
|
|||
import { useChild } from './childContext.component'
|
||||
import { ContactMenu } from './contactMenu.component'
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
// interface ClassmatesProps {
|
||||
// setSelected: (value?: number | null) => void;
|
||||
// }
|
||||
|
|
|
@ -23,8 +23,6 @@ interface ContactMenuProps {
|
|||
setSelected: (value?: number | null) => void
|
||||
}
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
export const ContactMenu = ({
|
||||
contact,
|
||||
selected,
|
||||
|
|
|
@ -76,7 +76,6 @@ export const Login = () => {
|
|||
)
|
||||
|
||||
const { t } = useTranslation()
|
||||
// const t = (key: string) => key;
|
||||
|
||||
const valid = Personnummer.valid(personalIdNumber)
|
||||
|
||||
|
@ -200,7 +199,7 @@ export const Login = () => {
|
|||
console.log('BankID ok')
|
||||
showModal(true)
|
||||
setLoginStatusText(t('auth.loginSuccessful'))
|
||||
setTimeout(() => showModal(false), 0)
|
||||
setTimeout(() => showModal(false), 0) // Hack to get around the modalview rendering twice, avoids crashing the app in IOS.
|
||||
})
|
||||
} else {
|
||||
await api.login('201212121212')
|
||||
|
|
|
@ -21,8 +21,6 @@ import { translate } from '../utils/translation'
|
|||
import { useChild } from './childContext.component'
|
||||
import { MenuListItem } from './menuListItem.component'
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
export const Menu = () => {
|
||||
const styles = useStyleSheet(themedStyles)
|
||||
const child = useChild()
|
||||
|
|
|
@ -22,8 +22,6 @@ import { Markdown } from './markdown.component'
|
|||
import { RootStackParamList } from './navigation.component'
|
||||
import { NavigationTitle } from './navigationTitle.component'
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
interface NewsItemProps {
|
||||
navigation: StackNavigationProp<RootStackParamList, 'NewsItem'>
|
||||
route: RouteProp<RootStackParamList, 'NewsItem'>
|
||||
|
|
|
@ -12,8 +12,6 @@ import { useChild } from './childContext.component'
|
|||
import { CloseOutlineIcon, SearchIcon } from './icon.component'
|
||||
import { NewsListItem } from './newsListItem.component'
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
export const NewsList = () => {
|
||||
const styles = useStyleSheet(themedStyles)
|
||||
const child = useChild()
|
||||
|
|
|
@ -10,8 +10,6 @@ interface SaveToCalendarProps {
|
|||
event: CalendarItem
|
||||
}
|
||||
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
export const SaveToCalendar = ({ event }: SaveToCalendarProps) => {
|
||||
const [visible, setVisible] = React.useState(false)
|
||||
|
||||
|
|
|
@ -107,8 +107,6 @@ export const Day = ({ weekDay, lunch, lessons }: DayProps) => {
|
|||
}
|
||||
|
||||
export const Week = ({ child }: WeekProps) => {
|
||||
// const translate = (key: string) => key;
|
||||
|
||||
moment.locale(LanguageService.getLocale())
|
||||
const days = moment.weekdaysShort().slice(1, 6)
|
||||
const displayDate = getMeaningfulStartingDate(moment())
|
||||
|
|
|
@ -6,12 +6,12 @@ export const FeatureFlagsContext = React.createContext<Features>({
|
|||
LOGIN_BANK_ID_SAME_DEVICE_WITHOUT_ID: true,
|
||||
FOOD_MENU: false,
|
||||
CLASS_LIST: true,
|
||||
LOGIN_FREJA_EID: false, //! this has been added
|
||||
LOGIN_FREJA_EID: false, //! this has been added by salt team
|
||||
})
|
||||
|
||||
interface Props {
|
||||
features: Features
|
||||
children: React.ReactNode //! this has been added
|
||||
children: React.ReactNode //! this has been added by salt team
|
||||
}
|
||||
|
||||
export const FeatureProvider: React.FC<Props> = (props) => {
|
||||
|
|
|
@ -2,8 +2,6 @@ import i18n from 'i18n-js'
|
|||
import { useMemo } from 'react'
|
||||
import { useLangCode } from './useLangCode'
|
||||
|
||||
// const i18n = new I18n();
|
||||
|
||||
export const useTranslation = () => {
|
||||
const langCode = useLangCode()
|
||||
const output = useMemo(() => {
|
||||
|
|
|
@ -3,13 +3,11 @@ module.exports = {
|
|||
moduleFileExtensions: ['ts', 'js', 'html', 'tsx', 'jsx'],
|
||||
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
|
||||
transform: {
|
||||
// '\\.(js|ts|tsx)$': require.resolve('react-native/jest/preprocessor.js'),
|
||||
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
|
||||
'react-native/jest/assetFileTransformer.js'
|
||||
),
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
// 'node_modules/(?!(@react-native|react-native|@ronradtke/react-native-markdown-display|react-native-webview|react-native-calendar-events|react-native-simple-toast|react-native-modal-datetime-picker|@react-native-community/datetimepicker)/)',
|
||||
'node_modules/(?!(@react-native|react-native|@ronradtke/react-native-markdown-display|react-native-webview|react-native-calendar-events|react-native-simple-toast|react-native-modal-datetime-picker|@react-native-community/datetimepicker|@ui-kitten)/)',
|
||||
],
|
||||
testEnvironment: 'jsdom',
|
||||
|
|
|
@ -20,8 +20,6 @@ import 'moment/locale/zh-cn'
|
|||
import { I18nManager } from 'react-native'
|
||||
import { languages } from '../utils/translation'
|
||||
|
||||
// const i18n = new I18n();
|
||||
|
||||
const changeListeners: Record<string, any> = {}
|
||||
|
||||
let allString: Record<string, any> = {}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import i18n, { TranslateOptions } from 'i18n-js'
|
||||
|
||||
// const i18n = new I18n();
|
||||
|
||||
interface Language {
|
||||
langCode: string
|
||||
languageName: string
|
||||
|
|
Loading…
Reference in New Issue