Skip to content

Commit

Permalink
chore(sync): Sync blog source code to next-theme-coline
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 30, 2024
1 parent a52e03e commit f970d57
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/components/layouts/footer/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { theme } from "../../../theme/theme.css";
export const container = styled.css`
position: relative;
width: 100%;
max-width: ${theme.fontSize.calc(45)};
max-width: ${theme.fontSize.calc(50)};
margin: 0 auto;
padding: ${theme.spacing.calc(5)} ${theme.spacing.calc(8)};
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/components/layouts/grid/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export const container = styled.css`
> * {
width: calc((100% - ${theme.spacing.calc(4)}) / 3);
@media screen and (max-width: ${theme.fontSize.calc(75)}) {
@media screen and (max-width: ${theme.fontSize.calc(80)}) {
width: calc((100% - ${theme.spacing.calc(2)}) / 2);
}
@media screen and (max-width: ${theme.fontSize.calc(45)}) {
@media screen and (max-width: ${theme.fontSize.calc(50)}) {
width: 100%;
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/components/layouts/main/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React, { PropsWithChildren } from "react";
import { cx } from "@syfxlin/reve";
import * as styles from "./styles.css";

export type MainProps = PropsWithChildren<object>;
export type MainProps = PropsWithChildren<{
className?: string;
}>;

export const Main: React.FC<MainProps> = ({ children }) => {
return <main className={styles.container}>{children}</main>;
export const Main: React.FC<MainProps> = ({ children, className }) => {
return <main className={cx(styles.container, className)}>{children}</main>;
};
2 changes: 1 addition & 1 deletion src/components/layouts/main/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const container = styled.css`
position: relative;
margin: 0 auto;
width: 100%;
max-width: ${theme.fontSize.calc(45)};
max-width: ${theme.fontSize.calc(50)};
padding: 0 ${theme.spacing.calc(8)};
animation: fade-in 0.5s ease;
`;
40 changes: 21 additions & 19 deletions src/components/templates/articles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,29 @@ export const TemplateArticles: React.FC<TemplateArticlesProps> = (props) => {
return (
<>
<Header />
<Main>
<Hero />
{props.display === "document" && (
{props.display === "document" && (
<Main className={styles.document}>
<section>
<Renderer document={props.document?.document} position="top">
<Heading>{t("articles.heading")}</Heading>
{props.articles.map(item => <ArticleInfo key={`article-${item.link}`} data={item} />)}
</Renderer>
<Hero />
<Renderer document={props.document?.document} position="top" />
</section>
)}
{props.display === "articles" && (
<>
<section>
{props.articles.items.map(item => (
<ArticleInfo key={`article-${item.link}`} data={item} />
))}
</section>
<Pagination links="/" index={props.articles.index} pages={props.articles.pages} />
</>
)}
</Main>
<section>
<Heading>{t("articles.heading")}</Heading>
{props.articles.map(item => <ArticleInfo key={`article-${item.link}`} data={item} />)}
</section>
</Main>
)}
{props.display === "articles" && (
<Main>
<Hero />
<section>
{props.articles.items.map(item => (
<ArticleInfo key={`article-${item.link}`} data={item} />
))}
</section>
<Pagination links="/" index={props.articles.index} pages={props.articles.pages} />
</Main>
)}
<Footer />
</>
);
Expand Down
22 changes: 22 additions & 0 deletions src/components/templates/articles/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,25 @@ export const heading = styled.css`
z-index: 1;
}
`;

export const document = styled.css`
display: flex;
gap: ${theme.spacing.calc(8)};
max-width: ${theme.fontSize.calc(80)} !important;
> section {
flex: 1;
&:first-child {
flex-basis: 170%;
}
&:last-child {
flex-basis: 100%;
}
}
@media screen and (max-width: ${theme.fontSize.calc(80)}) {
display: block;
}
`;
2 changes: 1 addition & 1 deletion src/components/widgets/toc/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const container = styled.css`
height: 100%;
transform: translateX(100%);
@media screen and (max-width: ${theme.fontSize.calc(36 + 45)}) {
@media screen and (max-width: ${theme.fontSize.calc(36 + 50)}) {
display: none;
}
Expand Down

0 comments on commit f970d57

Please sign in to comment.