mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-09-11 18:56:15 +02:00
refactor(starter): upgrade and move to typescript
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
.author {
|
||||
border-top: 1px solid $color-gray-border;
|
||||
max-width: $layout-post-width;
|
||||
padding-top: 20px;
|
||||
@include padding-top(1);
|
||||
@include line-height(1);
|
||||
@include margin-top(1);
|
||||
@include margin-bottom(2);
|
||||
|
||||
&__bio {
|
||||
&-twitter {
|
||||
.bio {
|
||||
.twitter {
|
||||
display: block;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
@@ -10,11 +10,11 @@ const mockedStaticQuery = StaticQuery as jest.Mock;
|
||||
const mockedUseStaticQuery = useStaticQuery as jest.Mock;
|
||||
|
||||
describe("Author", () => {
|
||||
console.log(mockedStaticQuery);
|
||||
beforeEach(() => {
|
||||
mockedStaticQuery.mockImplementationOnce(({ render }) =>
|
||||
render(mocks.siteMetadata),
|
||||
);
|
||||
|
||||
mockedUseStaticQuery.mockReturnValue(mocks.siteMetadata);
|
||||
});
|
||||
|
||||
|
@@ -3,17 +3,17 @@ import React from "react";
|
||||
import { useSiteMetadata } from "@/hooks";
|
||||
import { getContactHref } from "@/utils";
|
||||
|
||||
import styles from "./Author.module.scss";
|
||||
import * as styles from "./Author.module.scss";
|
||||
|
||||
const Author = () => {
|
||||
const { author } = useSiteMetadata();
|
||||
|
||||
return (
|
||||
<div className={styles.author}>
|
||||
<p className={styles.author__bio}>
|
||||
<p className={styles.bio}>
|
||||
{author.bio}
|
||||
<a
|
||||
className={styles["author__bio-twitter"]}
|
||||
className={styles.twitter}
|
||||
href={getContactHref("twitter", author.contacts.twitter)}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
|
@@ -1,15 +1,10 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Author renders correctly 1`] = `
|
||||
<div
|
||||
className="author"
|
||||
>
|
||||
<p
|
||||
className="author__bio"
|
||||
>
|
||||
<div>
|
||||
<p>
|
||||
Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu.
|
||||
<a
|
||||
className="author__bio-twitter"
|
||||
href="https://www.twitter.com/#"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
|
Reference in New Issue
Block a user