Skip to content

Commit

Permalink
Merge branch 'early-unstable' into early
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Sep 25, 2024
2 parents 7c85d89 + dd4bc7f commit 1b9b374
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 10 deletions.
23 changes: 21 additions & 2 deletions src/renderer/pages/EarlyAccessPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function EarlyAccessPage() {
<p className="lead">{t('EarlyAccessPage.description')}</p>
<Main>
<div className="container--grid">
<div data-col-sm="2" />
<div data-col-sm="2"></div>
<div data-col-sm="4">
<Card css="is-selected card--image">
<img
Expand All @@ -32,6 +32,16 @@ function EarlyAccessPage() {
>
{t('general.join')}
</BtnSimple>
<span></span>
<BtnSimple
css="btn-simple--2"
type="link"
target="_blank"
href="https://www.patreon.com/posts/early-access-70000718"
aria={t('general.next')}
>
{t('general.install')}
</BtnSimple>
<p>{t('EarlyAccessPage.eaTier.description')}</p>
<ul
className="list"
Expand All @@ -58,6 +68,16 @@ function EarlyAccessPage() {
>
{t('general.join')}
</BtnSimple>
<span></span>
<BtnSimple
css="btn-simple--2"
type="link"
target="_blank"
href="https://www.patreon.com/posts/early-access-70000718"
aria={t('general.next')}
>
{t('general.install')}
</BtnSimple>
<p>{t('EarlyAccessPage.fanTier.description')}</p>
<ul
className="list"
Expand All @@ -67,7 +87,6 @@ function EarlyAccessPage() {
/>
</Card>
</div>
<div data-col-sm="2" />
</div>
</Main>
<Footer nextText="Exit" next="emulators" />
Expand Down
82 changes: 74 additions & 8 deletions src/renderer/pages/WelcomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import Main from 'components/organisms/Main/Main';
import ProgressBar from 'components/atoms/ProgressBar/ProgressBar';
import { useNavigate } from 'react-router-dom';
import { BtnSimple } from 'getbasecore/Atoms';
import Card from 'components/molecules/Card/Card';
import { useFetchCond } from 'hooks/useFetchCond';

// import { useTranslation } from 'react-i18next';
import Welcome from 'components/organisms/Wrappers/Welcome';
Expand Down Expand Up @@ -55,10 +57,32 @@ function WelcomePage() {
data: '',
modal: undefined,
dom: undefined,
news: undefined,
game_of_the_month: undefined,
});
const { disabledNext, disabledBack, updates, modal, dom } = statePage;
const {
disabledNext,
disabledBack,
updates,
modal,
dom,
news,
game_of_the_month,
} = statePage;

const navigate = useNavigate();

const newsWS = useFetchCond('https://token.emudeck.com/news.php');
useEffect(() => {
newsWS.post({}).then((data) => {
setStatePage({
...statePage,
news: data[0].news,
game_of_the_month: data[0].game_of_the_month,
});
});
}, []);

const selectMode = (value) => {
if (value === 'android') {
navigate('/android-welcome');
Expand Down Expand Up @@ -124,13 +148,6 @@ function WelcomePage() {
localStorage.setItem('ogStateAlternative', '');
localStorage.setItem('ogStateEmus', '');
}

if (second === true && mode === 'expert') {
navigate('/emulators');
}
if (second === true && mode === 'easy') {
navigate('/emulators');
}
});

// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -166,6 +183,55 @@ function WelcomePage() {
/>
)}
<EmuModal modal={modal} />

{second && (
<>
<Header title="EmuDeck News" />
<Main>
<div className="cards cards--maxi">
{news &&
news.map((item) => {
return (
<Card css="is-selected">
<a target="blank" href={item.link}>
<span class="h5">{item.title}</span>
<p>{item.desc}</p>
<img src={item.img} />
</a>
</Card>
);
})}
</div>
<span class="h2">
Games of the month by{' '}
<a
href="https://retrohandhelds.gg"
target="blank"
style={{ display: 'inline' }}
>
<img
src="https://retrohandhelds.gg/wp-content/uploads/2023/08/rh_logo_white.svg"
alt="RG logo"
style={{ width: 40 }}
/>
</a>
</span>
<div className="cards cards--maxi">
{game_of_the_month &&
game_of_the_month.map((item) => {
return (
<Card css="is-selected">
<a target="blank" href={item.link}>
<span class="h5">{item.title}</span>
<img src={item.img} />
</a>
</Card>
);
})}
</div>
</Main>
</>
)}
</Wrapper>
);
}
Expand Down

0 comments on commit 1b9b374

Please sign in to comment.