Skip to content

Commit

Permalink
fix(react): remove console errors (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
y-lakhdar authored Jul 28, 2021
1 parent ce25520 commit ed4069f
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 10 deletions.
Binary file added packages/cra-template/template/public/favicon.ico
Binary file not shown.
15 changes: 15 additions & 0 deletions packages/cra-template/template/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Coveo Search Page Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
7 changes: 6 additions & 1 deletion packages/cra-template/template/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ const Home = () => {
const Error = () => {
return (
<Box height="100vh" display="flex" align-items="center">
<Grid container direction="row" justify="center" alignItems="center">
<Grid
container
direction="row"
justifyContent="center"
alignItems="center"
>
<Grid item md={9} sm={11}>
<div className="container">
<Typography variant="h4" color="error">
Expand Down
15 changes: 10 additions & 5 deletions packages/cra-template/template/src/Components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ const Hero: React.FunctionComponent<IHeroProps> = (props) => {
return (
<header className="App-header">
<Grid className="logo-container">
{props.logos.map((logo) => (
<img src={logo} className="App-logo" alt="logo" />
{props.logos.map((logo, idx) => (
<img
src={logo}
key={'image-' + idx}
className="App-logo"
alt="logo"
/>
))}
</Grid>

Expand Down Expand Up @@ -62,16 +67,16 @@ const Hero: React.FunctionComponent<IHeroProps> = (props) => {
Essential Links
</Typography>
<ul>
<li>
<li key="item-link-headless">
<Anchor
href="https://docs.coveo.com/en/headless"
value="Coveo Headless documentation"
/>
</li>
<li>
<li key="item-link-react">
<Anchor href="https://reactjs.org" value="React documentation" />
</li>
<li>
<li key="item-link-material">
<Anchor
href="https://material-ui.com/"
value="Material-ui Documentation"
Expand Down
5 changes: 4 additions & 1 deletion packages/cra-template/template/src/Components/Pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const PagerRenderer: FunctionComponent<PagerProps> = (props) => {
const [state, setState] = useState(controller.state);

useEffect(
() => controller.subscribe(() => setState(controller.state)),
() =>
controller.subscribe(() =>
setTimeout(() => setState(controller.state), 0)
),
[controller]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const SearchPage: React.FunctionComponent<ISearchPageProps> = (props) => {
return (
<EngineProvider value={engine}>
<Container maxWidth="lg">
<Grid container justify="center">
<Grid container justifyContent="center">
<Grid item md={8}>
<SearchBox />
</Grid>
Expand Down
4 changes: 2 additions & 2 deletions packages/cra-template/template/src/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import red from '@material-ui/core/colors/red';
import {createMuiTheme} from '@material-ui/core/styles';
import {createTheme} from '@material-ui/core/styles';

// A custom theme for this app
const theme = createMuiTheme({
const theme = createTheme({
palette: {
type: 'light',
text: {
Expand Down

0 comments on commit ed4069f

Please sign in to comment.