Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New landing #362

Merged
merged 40 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
088b42d
new landing
Ledchig Aug 14, 2023
eec91ce
Merge branch 'hexlet-rus:main' into main
Ledchig Aug 20, 2023
7e81324
added all elements on landing
Ledchig Aug 20, 2023
c22faef
Merge branch 'hexlet-rus:main' into main
Ledchig Aug 24, 2023
31200ac
add new FAQ and update spaces, bgImage
Ledchig Aug 24, 2023
035bd85
update border color
Ledchig Aug 24, 2023
c113501
Merge branch 'hexlet-rus:main' into main
Ledchig Sep 3, 2023
eb45068
update styles for pc
Ledchig Sep 3, 2023
ea461be
Merge branch 'hexlet-rus:main' into main
Ledchig Sep 11, 2023
c4a3d72
update footer
Ledchig Sep 16, 2023
6672f5d
Merge branch 'hexlet-rus:main' into main
Ledchig Sep 20, 2023
91ffaef
adda i18n
Ledchig Sep 20, 2023
a8872da
Merge branch 'hexlet-rus:main' into main
Ledchig Oct 5, 2023
fe3d17d
Merge branch 'hexlet-rus:main' into main
Ledchig Oct 16, 2023
5f15945
Merge branch 'hexlet-rus:main' into main
Ledchig Nov 7, 2023
ee85966
Merge branch 'hexlet-rus:main' into main
Ledchig Nov 9, 2023
e47d2fb
update faq h2
Ledchig Nov 9, 2023
a32daea
Merge branch 'hexlet-rus:main' into main
Ledchig Nov 21, 2023
7220a6a
add hover effect on nav-links
Ledchig Nov 24, 2023
e923d65
add button-start hover effect
Ledchig Nov 24, 2023
74b7a4d
Merge branch 'hexlet-rus:main' into main
Ledchig Nov 27, 2023
d9efd55
add all links, update header, footer
Ledchig Nov 27, 2023
3ac977a
add inline advantages block with mouse scroll
Ledchig Dec 3, 2023
7bb8689
add backgroud for points block
Ledchig Dec 8, 2023
5c63862
add background images
Ledchig Dec 12, 2023
70e914f
add background images
Ledchig Dec 12, 2023
b2fc228
update horizontal scroll
Ledchig Dec 15, 2023
eaa9b67
add styles for signin and signup buttons
Ledchig Dec 16, 2023
755414b
Merge branch 'hexlet-rus:main' into main
Ledchig Dec 26, 2023
2aa2d28
add fonts, update theme colors and imgs
Ledchig Dec 26, 2023
43aa390
update footer width
Ledchig Dec 27, 2023
949f255
update overflow bg image and footer width
Ledchig Dec 27, 2023
24cdecd
update bg images, header and footer lists
Ledchig Jan 3, 2024
7656f4e
update auth buttons text
Ledchig Jan 9, 2024
c395499
update detector theme mode
Ledchig Jan 9, 2024
0ef3a73
Update comments from tester
Ledchig Jan 9, 2024
ba28aa6
update header
Ledchig Jan 9, 2024
3829710
update header
Ledchig Jan 9, 2024
a1eeace
fix theme mode detect
Ledchig Jan 14, 2024
51c3c0b
update routes for newLanding
Ledchig Feb 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontend/src/AppRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import ScrollToTop from './utils/scrollToTop.js';

import DefaultLoader from './components/Loaders/DefaultLoader.jsx';

const Landing = lazy(() => import('./pages/landing'));
const NewLanding = lazy(() => import('./landing/Landing.jsx'));

const ProfilePage = lazy(() => import('./pages/profile'));
const SettingsPage = lazy(() => import('./pages/settings'));
const SnippetPage = lazy(() => import('./pages/snippet'));
const AboutPage = lazy(() => import('./pages/about'));
const SignUpPage = lazy(() => import('./pages/signup'));
const SignInPage = lazy(() => import('./pages/signin'));
const Landing = lazy(() => import('./pages/landing'));
const LicenseAgreement = lazy(() => import('./pages/license-agreement'));
const ForgotPasswordPage = lazy(() => import('./pages/forgot-password'));
const ResetPasswordPage = lazy(() => import('./pages/reset-password'));
Expand Down Expand Up @@ -53,7 +55,8 @@ function AppRoutes() {
<Suspense fallback={<DefaultLoader />}>
<ScrollToTop />
<Routes>
<Route path="/" element={<Layout />}>
<Route path={routes.newLandingPath()} element={<NewLanding />} />
<Route element={<Layout />}>
<Route index element={<Landing />} />
<Route path={routes.homePagePath()} element={<SnippetPage />} />
<Route path={routes.snippetPagePath()} element={<SnippetPage />} />
Expand Down
164 changes: 164 additions & 0 deletions frontend/src/landing/Faq.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
import { useContext } from 'react';
import {
Accordion,
Row,
Col,
useAccordionButton,
AccordionContext,
} from 'react-bootstrap';
import { useTranslation } from 'react-i18next';

function CustomToggle({ children, eventKey }) {
const { activeEventKey } = useContext(AccordionContext);

const decoratedOnClick = useAccordionButton(eventKey);

const isCurrentEventKey = activeEventKey === eventKey;

const theme = document.documentElement.getAttribute('data-bs-theme');

const colorForEl = theme === 'light' ? 'black' : 'white';

return (
<div
className={
isCurrentEventKey
? 'd-grid'
: `d-grid border-bottom border-${colorForEl}`
}
>
<button
className="btn py-4 d-flex justify-content-between align-items-center text-start"
onClick={decoratedOnClick}
type="button"
>
<h3 className="m-0 me-3">{children}</h3>
{isCurrentEventKey ? (
<div className="ms-3">
<svg
fill="none"
height="48"
viewBox="0 0 48 48"
width="48"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 30L24 18L12 30"
stroke={colorForEl}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="4"
/>
</svg>
</div>
) : (
<div className="ms-3">
<svg
fill="none"
height="48"
viewBox="0 0 48 48"
width="48"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 18L24 30L36 18"
stroke={colorForEl}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="4"
/>
</svg>
</div>
)}
</button>
</div>
);
}

function Faq() {
const { t } = useTranslation();

return (
<Row>
<Col className="my-5 pb-3" id="faq">
<h2 className=" pb-3 mb-4">{t('faq.faq')}</h2>
<Accordion defaultActiveKey="0" flush>
<div>
<CustomToggle eventKey="0">{t('faq.q0')}</CustomToggle>
<Accordion.Collapse eventKey="0">
<article className="px-3 ">
<p>{t('faq.a0')}</p>
</article>
</Accordion.Collapse>
</div>
<div>
<CustomToggle eventKey="1">{t('faq.q2')}</CustomToggle>
<Accordion.Collapse eventKey="1">
<article className="px-3 ">
<p>{t('faq.a2')}</p>
<p>
<b>{t('faq.a21')}</b>
</p>
<p>{t('faq.a22')}</p>
<p>
<b>{t('faq.a23')}</b>
</p>
<p>{t('faq.a24')}</p>
</article>
</Accordion.Collapse>
</div>
<div>
<CustomToggle eventKey="2">{t('faq.q3')}</CustomToggle>
<Accordion.Collapse eventKey="2">
<article className="px-3 ">
<p>{t('faq.a3')}</p>
</article>
</Accordion.Collapse>
</div>
<div>
<CustomToggle eventKey="3">{t('faq.q1')}</CustomToggle>
<Accordion.Collapse eventKey="3">
<article className="px-3 ">
<p>{t('faq.a11')}</p>
<p>
<b>{t('faq.a110')}</b>
</p>
<p>{t('faq.a111')}</p>
<p>
<b>{t('faq.a112')}</b>
</p>
<p>{t('faq.a113')}</p>
<p>
<b>{t('faq.a114')}</b>
</p>
<p>{t('faq.a115')}</p>
<p>
<b>{t('faq.a116')}</b>
</p>
<p>{t('faq.a117')}</p>
<p>
<b>{t('faq.a12')}</b>
</p>
<p>{t('faq.a13')}</p>
<p>
<b>{t('faq.a14')}</b>
</p>
<p>{t('faq.a15')}</p>
<p>
<b>{t('faq.a16')}</b>
</p>
<p>{t('faq.a17')}</p>
<p>
<b>{t('faq.a18')}</b>
</p>
<p>{t('faq.a19')}</p>
</article>
</Accordion.Collapse>
</div>
</Accordion>
</Col>
</Row>
);
}

export default Faq;
Loading
Loading