Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react): improve react hero banner + links #114

Merged
merged 1 commit into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cra-template/template/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {useEffect} from 'react';
import SearchPage from './Components/SearchPage';
import Hero from './Components/Hero';
import logo from './logo.svg';
import coveologo from './coveologo.svg';
import {BrowserRouter as Router, Route} from 'react-router-dom';
import {Grid, Typography, Box} from '@material-ui/core';
import {initializeHeadlessEngine} from './common/Engine';
Expand Down Expand Up @@ -47,10 +48,9 @@ const Home = () => {
return (
<div className="App">
<Hero
logo={logo}
logos={[logo, coveologo]}
welcome="Welcome to Your Coveo React.js Search Page"
/>
{/* <div>dsadsadsa</div> */}
{engine && <SearchPage engine={engine} />}
</div>
);
Expand Down
6 changes: 5 additions & 1 deletion packages/cra-template/template/src/Components/Hero.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.App-logo {
height: 40vmin;
height: 30vmin;
pointer-events: none;
}

Expand Down Expand Up @@ -32,3 +32,7 @@
.App-header a {
color: #1cebcf;
}

.logo-container {
margin: 2rem;
}
39 changes: 23 additions & 16 deletions packages/cra-template/template/src/Components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
import {Typography} from '@material-ui/core';
import {Grid, Typography} from '@material-ui/core';
import React from 'react';
import './Hero.css';

interface IHeroProps {
logo: string;
logos: string[];
welcome: string;
}

function Anchor(props: any) {
interface IAnchorProps {
href: string;
value: string;
}

function Anchor(props: IAnchorProps) {
return <a href={props.href}>{props.value}</a>;
}

const Hero: React.FunctionComponent<IHeroProps> = (props) => {
return (
<header className="App-header">
<img src={props.logo} className="App-logo" alt="logo" />
<Grid className="logo-container">
{props.logos.map((logo) => (
<img src={logo} className="App-logo" alt="logo" />
))}
</Grid>

<Typography variant="h5">{props.welcome}</Typography>
<Typography variant="body1">
This sample search page was built with{' '}
Expand All @@ -37,12 +47,15 @@ const Hero: React.FunctionComponent<IHeroProps> = (props) => {
and save to reload.
</Typography>

<Typography variant="subtitle1" component="h6">
Customize your search page theme
</Typography>
<Typography variant="body1">
You can customize your theme by modifying the{' '}
<b>
<code>src/theme.tsx</code>
</b>{' '}
file. For more information about theme customization, visit{' '}
</b>
. For more information about theme customization, visit{' '}
<Anchor
href="https://material-ui.com/customization/theming/"
value="Material-ui theming"
Expand All @@ -57,22 +70,16 @@ const Hero: React.FunctionComponent<IHeroProps> = (props) => {
<li>
<Anchor
href="https://docs.coveo.com/en/headless"
value="Coveo Connect"
/>
</li>
<li>
<Anchor
href="https://connect.coveo.com/"
value="Coveo Headless Library"
value="Coveo Headless documentation"
/>
</li>
<li>
<Anchor href="https://reactjs.org" value="Learn React" />
<Anchor href="https://reactjs.org" value="React documentation" />
</li>
<li>
<Anchor
href="https://material-ui.com/getting-started/usage/"
value="Learn Material-UI"
href="https://material-ui.com/"
value="Material-ui Documentation"
/>
</li>
</ul>
Expand Down
60 changes: 60 additions & 0 deletions packages/cra-template/template/src/coveologo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.