-
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
11 changed files
with
211 additions
and
140 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,30 @@ | ||
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; | ||
} | ||
|
||
function CommuneTab({commune}: CommuneTabProps) { | ||
const {baseLocale} = useContext(BalDataContext) | ||
const {token} = useContext(TokenContext) | ||
|
||
return ( | ||
<Pane overflowY='auto'> | ||
{!token && <ReadOnlyInfos />} | ||
{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,42 @@ | ||
import React, {useState} from 'react' | ||
import {Pane, Alert, Text, Button} from 'evergreen-ui' | ||
import RecoverBALAlert from '../bal-recovery/recover-bal-alert' | ||
|
||
function BALReadOnly() { | ||
const [isDialogOpen, setIsDialogOpen] = useState(false) | ||
|
||
return ( | ||
<> | ||
<RecoverBALAlert isShown={isDialogOpen} onClose={() => { | ||
setIsDialogOpen(false) | ||
}} /> | ||
<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={() => { | ||
setIsDialogOpen(true) | ||
}} | ||
> | ||
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.