mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 15:35:35 +00:00
fix: index page responsive
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import BlockWrapper from "components/BlockWrapper/BlockWrapper";
|
import BlockWrapper from "components/BlockWrapper/BlockWrapper";
|
||||||
import ButtonLink from "components/ButtonLink";
|
import ButtonLink from "components/ButtonLink";
|
||||||
import LangSelector from "components/LangSelector";
|
|
||||||
import Links from "components/Links/Links";
|
import Links from "components/Links/Links";
|
||||||
import Modal from "components/Modal/Modal";
|
import Modal from "components/Modal/Modal";
|
||||||
import PageTransition from "components/PageTransition";
|
import PageTransition from "components/PageTransition";
|
||||||
@@ -21,6 +20,7 @@ import { useCallback, useMemo, useState } from "react";
|
|||||||
import { useHotkeys } from "react-hotkeys-hook";
|
import { useHotkeys } from "react-hotkeys-hook";
|
||||||
import { Category, Link, SearchItem } from "types";
|
import { Category, Link, SearchItem } from "types";
|
||||||
import { withAuthentication } from "utils/session";
|
import { withAuthentication } from "utils/session";
|
||||||
|
import clsx from "clsx";
|
||||||
|
|
||||||
interface HomePageProps {
|
interface HomePageProps {
|
||||||
categories: Category[];
|
categories: Category[];
|
||||||
@@ -139,39 +139,12 @@ export default function HomePage(props: HomePageProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageTransition
|
<PageTransition
|
||||||
className="App"
|
className={clsx("App", "flex-row")}
|
||||||
style={{ flexDirection: "row" }}
|
style={{ flexDirection: "row" }}
|
||||||
hideLangageSelector
|
hideLangageSelector
|
||||||
>
|
>
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
<>
|
<UserCard />
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<UserCard />
|
|
||||||
<LangSelector />
|
|
||||||
</span>
|
|
||||||
<AnimatePresence>
|
|
||||||
{mobileModal.isShowing && (
|
|
||||||
<Modal close={mobileModal.close}>
|
|
||||||
<BlockWrapper style={{ minHeight: "0", flex: "1" }}>
|
|
||||||
<ButtonLink href={PATHS.CATEGORY.CREATE}>
|
|
||||||
{t("common:category.create")}
|
|
||||||
</ButtonLink>
|
|
||||||
<Categories
|
|
||||||
categories={categories}
|
|
||||||
categoryActive={categoryActive}
|
|
||||||
handleSelectCategory={handleSelectCategory}
|
|
||||||
/>
|
|
||||||
</BlockWrapper>
|
|
||||||
</Modal>
|
|
||||||
)}
|
|
||||||
</AnimatePresence>
|
|
||||||
</>
|
|
||||||
) : (
|
) : (
|
||||||
<SideMenu
|
<SideMenu
|
||||||
categories={categories}
|
categories={categories}
|
||||||
@@ -199,6 +172,20 @@ export default function HomePage(props: HomePageProps) {
|
|||||||
noHeader={!isMobile}
|
noHeader={!isMobile}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{mobileModal.isShowing && (
|
||||||
|
<Modal close={mobileModal.close}>
|
||||||
|
<BlockWrapper style={{ minHeight: "0", flex: "1" }}>
|
||||||
|
<ButtonLink href={PATHS.CATEGORY.CREATE}>
|
||||||
|
{t("common:category.create")}
|
||||||
|
</ButtonLink>
|
||||||
|
<Categories
|
||||||
|
categories={categories}
|
||||||
|
categoryActive={categoryActive}
|
||||||
|
handleSelectCategory={handleSelectCategory}
|
||||||
|
/>
|
||||||
|
</BlockWrapper>
|
||||||
|
</Modal>
|
||||||
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</PageTransition>
|
</PageTransition>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -199,6 +199,10 @@ kbd {
|
|||||||
right: 2em;
|
right: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-row {
|
||||||
|
flex-direction: row !important;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 1280px) {
|
@media (max-width: 1280px) {
|
||||||
.App {
|
.App {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -209,4 +213,8 @@ kbd {
|
|||||||
.App {
|
.App {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-row {
|
||||||
|
flex-direction: column !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user