Skip to content

Commit

Permalink
Add flag for directory
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Sep 4, 2024
1 parent 1bc1ae7 commit c6991cc
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/pages/Documentation/DocumentationCard/DocumentationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,54 +115,54 @@ export const DocumentationCard = memo((props: Props) => {
</div>
</div>
<div className={classes.buttonsWrapper}>
{(()=>{
{(() => {

const localizedString = (()=>{
const localizedString = (() => {

if( rest.isDirectory ) {
return undefined;
if (rest.isDirectory) {
return abstract;
}

if( rest.articleUrl ){
if (rest.articleUrl) {
return rest.articleUrl;
}

if( rest.deploymentUrl ){
switch( rest.deploymentUrl.type ){
if (rest.deploymentUrl) {
switch (rest.deploymentUrl.type) {
case "url":
return rest.deploymentUrl.url;
case "url by ide name":
return Object.values(rest.deploymentUrl.urlByIdeName)
.map(localizedString => typeof localizedString === "string" ? { "fr": localizedString } : localizedString)
.reduce((acc, curr) => ({
...acc,
...curr
}), id<Partial<Record<Language, string>>>({}));
case "url by ide name":
return Object.values(rest.deploymentUrl.urlByIdeName)
.map(localizedString => typeof localizedString === "string" ? { "fr": localizedString } : localizedString)
.reduce((acc, curr) => ({
...acc,
...curr
}), id<Partial<Record<Language, string>>>({}));
}
}

return undefined;

})();

if( localizedString === undefined ){
if (localizedString === undefined) {
return null;
}

return (
<Flags
lang={lang}
onChangeLanguage={lang => setLang(lang)}
localizedString={localizedString}
/>
<Flags
lang={lang}
onChangeLanguage={lang => setLang(lang)}
localizedString={localizedString}
/>
);


})()}
<div style={{ "flex": 1 }} />
{rest.isDirectory ? (
<Button
onClick={rest.onOpen}
<Button
onClick={rest.onOpen}
variant="secondary"
startIcon="directory"
>
Expand Down

0 comments on commit c6991cc

Please sign in to comment.