Skip to content

Commit

Permalink
TypeScript proof of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
jwngr committed Jun 15, 2024
1 parent aec621b commit 4524e25
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 189 deletions.
2 changes: 1 addition & 1 deletion website/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "react-app"
"extends": "react-app",
}
108 changes: 45 additions & 63 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"redux": "^4.2.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"styled-components": "^5.0.1",
"styled-components": "^6.1.11",
"typeface-crimson-text": "1.1.13",
"typeface-quicksand": "1.1.13"
},
Expand All @@ -35,8 +35,8 @@
},
"scripts": {
"analyze": "source-map-explorer build/static/js/*",
"lint": "prettier --check 'src/**/*.{js,css}'",
"format": "prettier --write 'src/**/*.{js,css}'",
"lint": "prettier --check 'src/**/*.{js,jsx,ts,tsx,json,css}'",
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css}'",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
Expand Down
39 changes: 0 additions & 39 deletions website/src/components/ErrorMessage.js

This file was deleted.

34 changes: 34 additions & 0 deletions website/src/components/ErrorMessage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import styled from 'styled-components';

const ErrorMessageWrapper = styled.p`
width: 700px;
margin: 40px auto;
font-size: 28px;
text-align: center;
line-height: 1.5;
color: ${(props) => props.theme.colors.red};
text-shadow: black 1px 1px;
@media (max-width: 1200px) {
width: 70%;
font-size: 24px;
}
`;

export const ErrorMessage: React.FC<{
readonly errorMessage: string;
}> = ({errorMessage}) => {
if (!errorMessage) return null;

const tokens = errorMessage.split('"');

return (
<ErrorMessageWrapper>
{tokens.map((token, i) =>
// Bold page titles in the provided error message.
i % 2 === 0 ? <span key={i}>{token}</span> : <b key={i}>"{token}"</b>
)}
</ErrorMessageWrapper>
);
};
79 changes: 0 additions & 79 deletions website/src/components/Home.js

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 4524e25

Please sign in to comment.