mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Front page forum entry nowrap, layout fixes
This commit is contained in:
parent
2b491e6bec
commit
09c45f7209
3 changed files with 96 additions and 59 deletions
|
@ -19,6 +19,82 @@ const renderSnow = () => {
|
||||||
return date.getMonth() === 11 && date.getDate() > 5
|
return date.getMonth() === 11 && date.getDate() > 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TopBar({
|
||||||
|
setSidebarOpen,
|
||||||
|
sidebarOpen,
|
||||||
|
closeSideBar,
|
||||||
|
href,
|
||||||
|
unreads,
|
||||||
|
userId,
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<MenuIcon setSidebarOpen={setSidebarOpen} sidebarOpen={sidebarOpen} />
|
||||||
|
<Link href="/">
|
||||||
|
<a>
|
||||||
|
<img
|
||||||
|
src={`${constants.siteUrl}img/frylabs-logo_small_transparent.png`}
|
||||||
|
alt="FryLabs"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
<div className={styles.topBarLinks}>
|
||||||
|
{Object.keys(topBarLinks).map((key) => {
|
||||||
|
const item = topBarLinks[key]
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Link key={key} href={item.href}>
|
||||||
|
<a
|
||||||
|
onClick={closeSideBar}
|
||||||
|
className={href.includes(key) ? styles.active : undefined}
|
||||||
|
>
|
||||||
|
{item.text}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
<div className={'seperator'} />
|
||||||
|
<UserStatus onClick={closeSideBar} unreads={unreads} userId={userId} />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function SideBar({ sidebarOpen, closeSideBar, href, setDonateShowing }) {
|
||||||
|
return sidebarOpen ? (
|
||||||
|
<>
|
||||||
|
<div id="sideBarLinks" className={styles.sidebarLinks}>
|
||||||
|
{Object.keys(tabs).map((key) => {
|
||||||
|
const item = tabs[key]
|
||||||
|
if (item.seperator) {
|
||||||
|
return <hr key={key} />
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Link href={item.href} key={key}>
|
||||||
|
<a
|
||||||
|
onClick={closeSideBar}
|
||||||
|
className={href.includes(key) ? styles.active : undefined}
|
||||||
|
id={item.id || undefined}
|
||||||
|
>
|
||||||
|
{item.text}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
closeSideBar()
|
||||||
|
setDonateShowing(true)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Donate
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
|
||||||
function Donate() {
|
function Donate() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -165,67 +241,22 @@ export default function Layout({ children, router, globalData }) {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className={styles.topBar}>
|
<div className={styles.topBar}>
|
||||||
<MenuIcon setSidebarOpen={setSidebarOpen} sidebarOpen={sidebarOpen} />
|
<TopBar
|
||||||
<Link href="/">
|
setSidebarOpen={setSidebarOpen}
|
||||||
<a>
|
sidebarOpen={sidebarOpen}
|
||||||
<img
|
closeSideBar={closeSideBar}
|
||||||
src={`${constants.siteUrl}img/frylabs-logo_small_transparent.png`}
|
href={href}
|
||||||
alt="FryLabs"
|
unreads={unreads}
|
||||||
/>
|
userId={userId}
|
||||||
</a>
|
/>
|
||||||
</Link>
|
|
||||||
<div className={styles.topBarLinks}>
|
|
||||||
{Object.keys(topBarLinks).map((key) => {
|
|
||||||
const item = topBarLinks[key]
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Link key={key} href={item.href}>
|
|
||||||
<a
|
|
||||||
onClick={closeSideBar}
|
|
||||||
className={href.includes(key) ? styles.active : undefined}
|
|
||||||
>
|
|
||||||
{item.text}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
<div className={'seperator'} />
|
|
||||||
<UserStatus onClick={closeSideBar} unreads={unreads} userId={userId} />
|
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.sidebar}>
|
<div className={styles.sidebar}>
|
||||||
{sidebarOpen ? (
|
<SideBar
|
||||||
<>
|
sidebarOpen={sidebarOpen}
|
||||||
<div id="sideBarLinks" className={styles.sidebarLinks}>
|
closeSideBar={closeSideBar}
|
||||||
{Object.keys(tabs).map((key) => {
|
href={href}
|
||||||
const item = tabs[key]
|
setDonateShowing={setDonateShowing}
|
||||||
if (item.seperator) {
|
/>
|
||||||
return <hr key={key} />
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Link href={item.href} key={key}>
|
|
||||||
<a
|
|
||||||
onClick={closeSideBar}
|
|
||||||
className={href.includes(key) ? styles.active : undefined}
|
|
||||||
id={item.id || undefined}
|
|
||||||
>
|
|
||||||
{item.text}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
closeSideBar()
|
|
||||||
setDonateShowing(true)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Donate
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
{donateShowing ? (
|
{donateShowing ? (
|
||||||
<Modal
|
<Modal
|
||||||
|
|
|
@ -69,6 +69,10 @@
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.userinfo a {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.newsRoot {
|
.newsRoot {
|
||||||
background-color: var(--dark-color);
|
background-color: var(--dark-color);
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
|
|
|
@ -26,8 +26,10 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
#__next {
|
#__next {
|
||||||
|
display: flex;
|
||||||
min-height: calc(100vh);
|
min-height: calc(100vh);
|
||||||
width: 1200px;
|
width: 1200px;
|
||||||
|
max-width: 1200px;
|
||||||
/* offset-x | offset-y | blur-radius | spread-radius | color */
|
/* offset-x | offset-y | blur-radius | spread-radius | color */
|
||||||
background-color: var(--background-color);
|
background-color: var(--background-color);
|
||||||
box-shadow: 0px 0px 29px 19px #222426;
|
box-shadow: 0px 0px 29px 19px #222426;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue