Skip to content

Commit

Permalink
Merge pull request #16 from thostetler/fix-favicon
Browse files Browse the repository at this point in the history
Merge over commits to sync with develop
  • Loading branch information
thostetler committed Dec 3, 2020
2 parents de7cc36 + 9691f6c commit c2a4acf
Show file tree
Hide file tree
Showing 41 changed files with 93 additions and 135 deletions.
3 changes: 0 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ RUN apt-get update && apt-get install -y \
libxtst6 \
xauth \
xvfb

# Install doppler during build phase
RUN (curl -Ls https://cli.doppler.com/install.sh || wget -qO- https://cli.doppler.com/install.sh) | sh
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.8'
version: '3.3'

services:
app:
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ cache:
npm: true
directories:
- ~/.cache
env:
- PORT=8000 NEXT_PUBLIC_API_HOST=https://devapi.adsabs.harvard.edu/v1 HOST=http://localhost:8000
git:
submodules: false
install:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"name": "Next.js Server (debug)",
"runtimeExecutable": "/usr/local/share/npm-global/bin/ts-node",
"env": {
"NODE_OPTIONS": "--inspect"
"NODE_OPTIONS": "--inspect",
"NODE_ENV": "production"
},
"runtimeArgs": ["--project", "tsconfig.server.json", "server/index.ts"],
"port": 9229
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"debug.node.autoAttach": "off"
}
}
9 changes: 0 additions & 9 deletions components/__tests__/numfound.test.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config: Config.InitialOptions = {
testEnvironment: 'jsdom',
preset: 'ts-jest',
verbose: true,
roots: ['components'],
roots: ['src/components'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
Expand All @@ -15,7 +15,7 @@ const config: Config.InitialOptions = {
tsconfig: 'tsconfig.test.json',
},
},
collectCoverageFrom: ['components/**/*.tsx'],
collectCoverageFrom: ['src/components/**/*.tsx'],
coverageThreshold: {
global: {
lines: 0,
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@types/express": "^4.17.8",
"@types/express-rate-limit": "^5.1.0",
"@types/jest": "^26.0.15",
"@types/jest-axe": "^3.5.1",
"@types/morgan": "^1.9.1",
"@types/node": "^14.6.1",
"@types/qs": "^6.9.4",
Expand Down Expand Up @@ -63,6 +64,7 @@
"express": "^4.17.1",
"express-rate-limit": "^5.1.3",
"jest": "^26.6.3",
"jest-axe": "^4.1.0",
"morgan": "^1.10.0",
"next": "^10.0.2-canary.2",
"next-compose-plugins": "^2.2.0",
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
Binary file removed public/img/favicon-16x16.png
Binary file not shown.
Binary file removed public/img/favicon.ico
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders correctly 1`] = `
exports[`renders correctly with no props 1`] = `
<div>
<article
<p
class="text-xs"
role="status"
>
Expand All @@ -11,9 +11,9 @@ exports[`renders correctly 1`] = `
<span
class="font-bold"
>
10
0
</span>
results
</article>
</p>
</div>
`;
22 changes: 22 additions & 0 deletions src/components/__tests__/numfound.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { render } from '@testing-library/react';
import { axe, toHaveNoViolations } from 'jest-axe';
import React from 'react';
import NumFound from '../numfound';
expect.extend(toHaveNoViolations);

test('renders correctly with no props', async () => {
const { container } = render(<NumFound />);
expect(container).toMatchSnapshot();
expect(container).toHaveTextContent('Your search returned 0 results');
});

test('renders correctly with prop', async () => {
const { container } = render(<NumFound numFound={10} />);
expect(container).toHaveTextContent('Your search returned 10 results');
});

test('Has no accessibility violations', async () => {
render(<NumFound />);
const results = await axe(document.body);
expect(results).toHaveNoViolations();
});
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { DetailedHTMLProps, InputHTMLAttributes } from 'react';
import React, { DetailedHTMLProps, InputHTMLAttributes } from 'react';

const Checkbox: React.FC<DetailedHTMLProps<
InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>> = (props) => {
const Checkbox: React.FC<
DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>
> = (props) => {
const { children, ...inputProps } = props;

return (
Expand Down
9 changes: 4 additions & 5 deletions components/base/radio.tsx → src/components/base/radio.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { DetailedHTMLProps, InputHTMLAttributes } from 'react';
import React, { DetailedHTMLProps, InputHTMLAttributes } from 'react';

const Radio: React.FC<DetailedHTMLProps<
InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>> = (props) => {
const Radio: React.FC<
DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>
> = (props) => {
const { children, ...inputProps } = props;

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DetailedHTMLProps, TextareaHTMLAttributes } from 'react';
import React, { DetailedHTMLProps, TextareaHTMLAttributes } from 'react';

interface ITextareaProps
extends DetailedHTMLProps<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DetailedHTMLProps, InputHTMLAttributes } from 'react';
import React, { DetailedHTMLProps, InputHTMLAttributes } from 'react';

interface ITextboxProps
extends DetailedHTMLProps<
Expand Down
3 changes: 2 additions & 1 deletion components/footer.tsx → src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import Image from 'next/image';
import Link from 'next/link';
import React from 'react';

const SimpleLink: React.FC<{ href: string; icon?: IconProp }> = ({
children,
Expand Down Expand Up @@ -85,7 +86,7 @@ const Footer: React.FC = () => {
</div>
</div>
<div className="flex-col text-gray-100">
<p className="text-lg text-gray-100 mb-3">Resources</p>
<p className="text-lg mb-3">Resources</p>
<SimpleLink href="/about" icon={faQuestionCircle}>
About ADS
</SimpleLink>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions components/numfound.tsx → src/components/numfound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React from 'react';

const NumFound: React.FC<INumFoundProps> = React.memo(({ numFound = 0 }) => {
return (
<article role="status" className="text-xs">
<p role="status" className="text-xs">
Your search returned{' '}
<span className="font-bold">{numFound.toLocaleString()}</span> results
</article>
</p>
);
});

interface INumFoundProps {
numFound: number;
numFound?: number;
}

export default NumFound;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -63,63 +63,8 @@ const SearchBar: React.FC<ISearchBarProps> = () => {
</div>
</div>
);

// const classes = useStyles();

// return (
// <Autocomplete
// id="search-input"
// options={['test', 'test2']}
// openOnFocus={false}
// renderInput={(params) => (
// <Paper className={classes.root} innerRef={params.InputProps.ref}>
// <InputBase
// placeholder="Search"
// name="q"
// defaultValue={value}
// {...params.inputProps}
// className={classes.input}
// />
// <QuickFields />
// <IconButton
// className={classes.searchButton}
// aria-label="search"
// type="submit"
// >
// <SearchIcon />
// </IconButton>
// </Paper>
// )}
// />
// );
};

interface ISearchBarProps extends React.InputHTMLAttributes<HTMLInputElement> {}

// const useStyles = makeStyles((theme: Theme) =>
// createStyles({
// root: {
// padding: 0,
// display: 'flex',
// alignItems: 'center',
// width: '100%',
// },
// input: {
// marginLeft: theme.spacing(1),
// flex: 1,
// },
// iconButton: {
// padding: 10,
// },
// searchButton: {
// borderRadius: '0 4px 4px 0',
// color: theme.palette.getContrastText(theme.palette.secondary.main),
// backgroundColor: theme.palette.secondary.main,
// '&:hover': {
// backgroundColor: theme.palette.secondary.dark,
// },
// },
// })
// );

export default SearchBar;
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/_app.tsx → src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Layout from '@components/layout';
import '@styles/index.css';
import { AppProps } from 'next/app';
import Head from 'next/head';
import React from 'react';
import { RecoilRoot } from 'recoil';
import '../styles/index.css';

const NectarApp = ({ Component, pageProps }: AppProps) => {
return (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/classic-form.tsx → src/pages/classic-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const renderCollectionCheckboxes = (selected: string[]) => {
<span className="mr-1">Limit query to:</span>
<>
{['astronomy', 'physics', 'general'].map((label) => (
<label className="inline-flex items-center mx-1">
<label className="inline-flex items-center mx-1" key={label}>
<input
type="checkbox"
className="form-checkbox"
Expand Down
30 changes: 0 additions & 30 deletions pages/index.tsx → src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,36 +61,6 @@ const Home: React.FC = () => {
);
};

// const IsolatedSearchBar = () => {
// const [value, setValue] = React.useState('');
// const handleClear = () => {
// setValue('');
// };
// const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
// setValue(e.currentTarget.value);
// };

// const handleExampleClick = (text: string) => {
// setValue(`${value} ${text}`);
// };

// return (
// <>
// <div className="my-6">
// <SearchBar
// value={value}
// onChange={handleChange}
// onClear={handleClear}
// />
// </div>
// <div className="mt-4">
// <h3 className="text-lg text-center mb-3 font-bold">Search Examples</h3>
// <SearchExamples onClick={handleExampleClick} />
// </div>
// </>
// );
// };

const SearchExamples = React.memo<{ onClick(text: string): void }>(
({ onClick }) => {
const examplesLeft = [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
},
purge: {
mode: 'all',
content: ['./components/**/*.tsx', './pages/**/*.tsx'],
content: ['./src/components/**/*.tsx', './src/pages/**/*.tsx'],
},
theme: {
extend: {
Expand Down
11 changes: 4 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"@components/*": ["components/*"],
"@src/*": ["src/*"],
"@mocks/*": ["mocks/*"],
"@components/*": ["src/components/*"],
"@api/*": ["api/*"],
"@recoil/*": ["recoil/*"],
"@utils/*": ["utils/*"],
"@machines/*": ["machines/*"]
"@recoil/*": ["src/recoil/*"],
"@styles/*": ["styles/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "cypress", "components/__tests__"]
"exclude": ["node_modules", "cypress", "src/components/__tests__"]
}
6 changes: 5 additions & 1 deletion tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"compilerOptions": {
"jsx": "react"
},
"include": ["./components/**/*.test.tsx", "jest.config.ts", "jest.setup.ts"],
"include": [
"./src/components/**/*.test.tsx",
"jest.config.ts",
"jest.setup.ts"
],
"exclude": ["node_modules"]
}
Loading

0 comments on commit c2a4acf

Please sign in to comment.