Skip to content

Commit

Permalink
Fixed for standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Dec 2, 2023
1 parent 92bc6d7 commit b4d21ef
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 12 deletions.
5 changes: 1 addition & 4 deletions frontend/app/[locale]/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import AppHeader from '@/components/AppHeader/AppHeader';
import AppFooter from '@/components/AppFooter/AppFooter';
import AnalyticsAuthorizer from '@/components/AnalyticsAuthorizer/AnalyticsAuthorizer';
import StatusMessage from '@/components/StatusMessage/StatusMessage';
import { OneFullColumn } from '@/components/Layouts/Layouts';
// import MaintenanceWarning from '@/components/MaintenanceWarning/MaintenanceWarning';

/* * */
Expand All @@ -27,9 +26,7 @@ export default function Layout({ children, params: { locale } }) {
<AppWrapper>
<AppTopBar />
<AppHeader />
<OneFullColumn>
<StatusMessage />
</OneFullColumn>
<StatusMessage />
{/* <MaintenanceWarning /> */}
{children}
<AppFooter />
Expand Down
2 changes: 0 additions & 2 deletions frontend/components/Layouts/Layouts.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
height: 100%;
flex-grow: 1;
position: relative;
width: 100%;
margin: var(--size-lg) auto;
padding: 0 var(--size-lg);
}
Expand Down Expand Up @@ -40,7 +39,6 @@
height: 100%;
flex-grow: 1;
position: relative;
width: 100%;
}

/* * */
Expand Down
31 changes: 27 additions & 4 deletions frontend/components/StatusMessage/StatusMessage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
'use client';

/* * */

import styles from './StatusMessage.module.css';
import { useTranslations } from 'next-intl';
import { useState } from 'react';
import { ActionIcon } from '@mantine/core';
import { IconChevronDown, IconChevronLeft } from '@tabler/icons-react';

/* * */

Expand All @@ -11,17 +16,35 @@ export default function StatusMessage() {
//
// A. Setup variables

const isVisible = true;
const t = useTranslations('StatusMessage');
const [isVisible, setIsVisible] = useState(true);

//
// B. Render components

const handleSetIsVisible = () => {
setIsVisible((prev) => !prev);
};

//
// C. Render components

return (
<div className={styles.container}>
<h3 className={styles.title}>{t('title')}</h3>
<p className={styles.explanation}>{t('explanation')}</p>
<p className={styles.solution}>{t('solution')}</p>
<div className={styles.innerWrapper}>
<div className={styles.headerWrapper} onClick={handleSetIsVisible}>
<h3 className={styles.title}>{t('title')}</h3>
<ActionIcon variant="subtle" color="rgba(0, 0, 0, 1)" size="lg">
{isVisible ? <IconChevronDown size={20} /> : <IconChevronLeft size={20} />}
</ActionIcon>
</div>
{isVisible && (
<div className={styles.contentWrapper}>
<p className={styles.explanation}>{t('explanation')}</p>
<p className={styles.solution}>{t('solution')}</p>
</div>
)}
</div>
</div>
);

Expand Down
70 changes: 68 additions & 2 deletions frontend/components/StatusMessage/StatusMessage.module.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,84 @@
/* * */
/* CONTAINER */

.container {
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: stretch;
gap: var(--size-sm);
width: 100%;
max-width: 1400px;
height: 100%;
margin: auto;
margin-top: var(--size-lg);
padding: 0 var(--size-lg);
}

@media (max-width: 700px) {
.container {
padding: 0;
margin: 0;
}
}

@media all and (display-mode: standalone) {
.container {
padding: 0;
margin: 0;
max-width: none;
}
}

/* * */
/* INNER WRAPPER */

.innerWrapper {
width: 100%;
display: flex;
flex-direction: column;
gap: 10px;
background: #ffeebe;
padding: 15px 20px;
padding: 15px 18px;
border-radius: 10px;
}

@media (max-width: 700px) {
.container {
.innerWrapper {
border-radius: 0;
}
}

@media all and (display-mode: standalone) {
.innerWrapper {
border-radius: 0;
}
}

/* * */
/* HEADER WRAPPER */

.headerWrapper {
display: flex;
flex-direction: row;
gap: 10px;
align-items: center;
justify-content: space-between;
cursor: pointer;
}

/* * */
/* CONTENT WRAPPER */

.contentWrapper {
display: flex;
flex-direction: column;
gap: 10px;
}

/* * */
/* TEXTS */

.title,
.explanation,
.solution {
Expand Down

0 comments on commit b4d21ef

Please sign in to comment.