-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
393 additions
and
239 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, {useContext} from 'react' | ||
import {Pane} from 'evergreen-ui' | ||
|
||
import BalDataContext from '@/contexts/bal-data' | ||
import TokenContext from '@/contexts/token' | ||
|
||
import CertificationInfos from './certification-infos' | ||
import HabilitationInfos from './habilitation-infos' | ||
import ReadOnlyInfos from './read-only-infos' | ||
import {CommmuneType} from '@/types/commune' | ||
|
||
interface CommuneTabProps { | ||
commune: CommmuneType; | ||
openRecoveryDialog: () => void; | ||
} | ||
|
||
function CommuneTab({commune, openRecoveryDialog}: CommuneTabProps) { | ||
const {baseLocale} = useContext(BalDataContext) | ||
const {token} = useContext(TokenContext) | ||
|
||
return ( | ||
<Pane overflowY='auto'> | ||
{!token && <ReadOnlyInfos openRecoveryDialog={openRecoveryDialog} />} | ||
{token && baseLocale.status !== 'demo' && <HabilitationInfos commune={commune} />} | ||
<CertificationInfos /> | ||
</Pane> | ||
) | ||
} | ||
|
||
export default CommuneTab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react' | ||
import {Pane, Alert, Text, Button} from 'evergreen-ui' | ||
|
||
interface BALReadOnlyProps { | ||
openRecoveryDialog: () => void; | ||
} | ||
|
||
function BALReadOnly({openRecoveryDialog}: BALReadOnlyProps) { | ||
return ( | ||
<Pane | ||
backgroundColor='white' | ||
padding={8} | ||
borderRadius={10} | ||
margin={8} | ||
> | ||
<Alert | ||
intent='warning' | ||
title='Vous êtes en mode consultation' | ||
marginBottom={15} | ||
> | ||
<Text is='p'> | ||
Vous ne pouvez pas modifier cette Base Adresse Locale car vous n’êtes pas authentifié comme administrateur. | ||
</Text> | ||
<Text is='p'> | ||
Si vous êtes administrateur de cette Base Adresse Locale, vous pouvez récupérer vos accès en cliquant sur le bouton ci-dessous. | ||
</Text> | ||
<Button appearance='primary' onClick={openRecoveryDialog}> | ||
Récupérer mes accès | ||
</Button> | ||
</Alert> | ||
</Pane> | ||
) | ||
} | ||
|
||
export default BALReadOnly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.