Files
Chromacase/front/components/CompetenciesTable.tsx
Chloé Chauvin af8ec83cd6 104 page du profil utilisateur (#116)
* [ADD] profile page

* [DEL] empty lines

* [UPD] added translation for the profile page

* [UPD] link to the profile page

* [ADD] profile page

* [UPD] moved the progress bar component in its own file

* [UPD] moved the progress bar component

* [WIP] added all the elements to the profile view

* [WIP] added all the elements to the profile view

* User Slice: Use API Instance instead of access token

* Front: Fix API calls with JWT Token

* Front: Handle Empty Server response

* Front: Fix User Model

* Front: Signin Form: Fix submittingstate on error

* Front: Remove logs

* Front/translate refactor (#110)

* Front: i18n: Create component

* Front: Use new translation component

* Front: Translation COmpoent: Change props name

* Front: Fix merge

* Front: settings persistance (#108)

* Front: Add peristance dependencies

* Front: Fix Cross-platform persistance

* Front: Create Settings Slice

* Front: Use Redux State for settings

* Front: Check if access token is still valid

* Front: Create Language Gate to set correct language at startup

* Front: BEtter handling of Access Token validity

* 54-écran-de-titre (#109)

* [ADD] function to hide the splash screen

* [DEL] useless lines

* [ADD] compatibility

* [UPD] settings for the splash screen

* [ADD] chromacase logo on the splash screen

* [UPD] splash logo

* [UPD] set the timeout to 0

* [UPD] set the timeout to 500

* User Slice: Use API Instance instead of access token

* Front: Fix API calls with JWT Token

* Front: Handle Empty Server response

* Front: Fix User Model

* Front: Signin Form: Fix submittingstate on error

* Front: Remove logs

* Front/translate refactor (#110)

* Front: i18n: Create component

* Front: Use new translation component

* Front: Translation COmpoent: Change props name

* Front: Fix merge

* Front: settings persistance (#108)

* Front: Add peristance dependencies

* Front: Fix Cross-platform persistance

* Front: Create Settings Slice

* Front: Use Redux State for settings

* Front: Check if access token is still valid

* Front: Create Language Gate to set correct language at startup

* Front: BEtter handling of Access Token validity

* [MERGE]

* [DEL] useless lines

* [UPD] settings for the splash screen

* [UPD] set the timeout to 0

* [DEL] duplicated line

* [REVERT]

Co-authored-by: Arthi-chaud <arthur.jamet@gmail.com>
Co-authored-by: Arthur Jamet <60505370+Arthi-chaud@users.noreply.github.com>

* [FIX] splashscreen

* [ADD] profile page

* [UPD] link to the profile page

* [UPD] moved the progress bar component

* [FIX] translate

* [UPD] reorganized all translations for ease of use

* [UPD] translated all the texts and made the page more beautiful
[TODO] get the informations of the user

* [ADD] banner and level

Co-authored-by: Arthi-chaud <arthur.jamet@gmail.com>
Co-authored-by: Arthur Jamet <60505370+Arthi-chaud@users.noreply.github.com>
2023-01-13 18:28:06 +00:00

37 lines
1.1 KiB
TypeScript

import { useNavigation } from "@react-navigation/core";
import { HStack, VStack, Text, Progress, Pressable } from "native-base";
import { translate } from "../i18n/i18n";
import Card from './Card';
type CompetenciesTableProps = {
pedalsCompetency: number;
rightHandCompetency: number;
leftHandCompetency: number;
accuracyCompetency: number;
arpegeCompetency: number;
chordsCompetency: number;
}
const CompetenciesTable = (props: CompetenciesTableProps) => {
const navigation = useNavigation();
return <Pressable onPress={() => navigation.navigate('User')}>
{({ isHovered, isFocused }) => (
<Card padding={5} bg={(isHovered || isFocused) ? 'coolGray.200' : undefined }>
<HStack space={5} flex={1}>
<VStack space={5}>
{ Object.keys(props).map((competencyName) => (
<Text bold>{translate(competencyName as keyof CompetenciesTableProps)}</Text>
))}
</VStack>
<VStack space={5} flex={1}>
{ Object.keys(props).map((competencyName) => (
<Progress flex={1} value={props[competencyName as keyof CompetenciesTableProps]} />
))}
</VStack>
</HStack>
</Card>
)}
</Pressable>
}
export default CompetenciesTable