added legal pages, resized tablet view, fixed prettier

This commit is contained in:
2022-09-10 09:27:37 +02:00
parent 1cf766573d
commit f84e56f0ad
45 changed files with 719 additions and 2516 deletions

View File

@@ -2,9 +2,9 @@ import React from "react";
import { Link } from "gatsby";
import * as styles from "./Feed.module.scss";
import { Edge } from "@/types";
import * as styles from "./Feed.module.scss";
type Props = {
edges: Array<Edge>;

View File

@@ -1,8 +1,8 @@
import React from "react";
import * as styles from "./Icon.module.scss";
import { ICONS } from "@/constants";
import * as styles from "./Icon.module.scss";
interface Props {
name: keyof typeof ICONS;

View File

@@ -1,10 +1,10 @@
import React from "react";
import Helmet from "react-helmet";
import { useSiteMetadata } from "@/hooks";
import { CookieBar } from "../Cookiebar/CookieBar";
import * as styles from "./Layout.module.scss";
import { useSiteMetadata } from "@/hooks";
interface Props {
title: string;

View File

@@ -1,8 +1,8 @@
import React, { useEffect, useRef } from "react";
import * as styles from "./Page.module.scss";
import type { Nullable } from "@/types";
import * as styles from "./Page.module.scss";
interface Props {
title?: string;

View File

@@ -3,9 +3,9 @@ import React from "react";
import classNames from "classnames";
import { Link } from "gatsby";
import * as styles from "./Pagination.module.scss";
import { PAGINATION } from "@/constants";
import * as styles from "./Pagination.module.scss";
type Props = {
prevPagePath: string;

View File

@@ -1,8 +1,8 @@
import React from "react";
import * as styles from "./Author.module.scss";
import { useSiteMetadata } from "@/hooks";
import * as styles from "./Author.module.scss";
const Author = () => {
const { author } = useSiteMetadata();
@@ -10,7 +10,7 @@ const Author = () => {
return (
<div className={styles.author}>
<p className={styles.bio}>
Written by: <a href ="/pages/about">
Written by: <a href="/pages/about">
<strong>{author.name}</strong>
</a>
</p>

View File

@@ -2,7 +2,6 @@ import React from "react";
import { Link } from "gatsby";
import type { Node } from "@/types";
import { Author } from "./Author";
import { Comments } from "./Comments";
@@ -11,6 +10,7 @@ import { Meta } from "./Meta";
import { Tags } from "./Tags";
import * as styles from "./Post.module.scss";
import type { Node } from "@/types";
interface Props {
post: Node;

View File

@@ -2,9 +2,9 @@ import React from "react";
import { Link } from "gatsby";
import * as styles from "./Author.module.scss";
import { Image } from "@/components/Image";
import * as styles from "./Author.module.scss";
type Props = {
author: {

View File

@@ -1,11 +1,11 @@
import React from "react";
import * as styles from "./Contacts.module.scss";
import { Icon } from "@/components/Icon";
import { ICONS } from "@/constants";
import { Dictionary } from "@/types";
import { getContactHref, getIcon } from "@/utils";
import * as styles from "./Contacts.module.scss";
type Props = {
contacts: Dictionary<string>;

View File

@@ -14,13 +14,9 @@ type Props = {
const Menu: React.FC<Props> = ({ menu }: Props) => (
<nav className={styles.menu}>
<ul className={styles.list}>
{menu.map((item) => (
{menu?.map((item) => (
<li className={styles.item} key={item.path}>
<Link
to={item.path}
className={styles.link}
activeClassName={styles.active}
>
<Link to={item.path} className={styles.link} activeClassName={styles.active}>
{item.label}
</Link>
</li>

View File

@@ -12,7 +12,7 @@
@include breakpoint-sm {
.sidebar {
lost-column: 5/12;
lost-column: 3/12;
.inner {
@include padding(1.25, 0.75, 0);
@@ -40,8 +40,6 @@
@include breakpoint-md {
.sidebar {
lost-column: 1/4;
// TODO: column to 1/4?
// lost-column: 1/3;?
.inner {
@include padding-equal(1.5);

View File

@@ -1,20 +1,19 @@
import React from "react";
import { useSiteMetadata } from "@/hooks";
import { Author } from "./Author";
import { Contacts } from "./Contacts";
import { Copyright } from "./Copyright";
import { Menu } from "./Menu";
import * as styles from "./Sidebar.module.scss";
import { useSiteMetadata } from "@/hooks";
type Props = {
isIndex?: boolean;
};
const Sidebar = ({ isIndex }: Props) => {
const { author, copyright, menu } = useSiteMetadata();
const { author, copyright, menu, legalMenu } = useSiteMetadata();
return (
<div className={styles.sidebar}>
@@ -23,6 +22,7 @@ const Sidebar = ({ isIndex }: Props) => {
<Menu menu={menu} />
<Contacts contacts={author.contacts} />
<Copyright copyright={copyright} />
<Menu menu={legalMenu} />
</div>
</div>
);

View File

@@ -138,6 +138,9 @@ exports[`Sidebar renders correctly 1`] = `
<div>
All rights reserved.
</div>
<nav>
<ul />
</nav>
</div>
</div>
`;