Skip to content

Commit

Permalink
Merge pull request #14 from dabigjoe6/enhance-frequency
Browse files Browse the repository at this point in the history
Create header
  • Loading branch information
dabigjoe6 authored Jun 23, 2023
2 parents 842ac22 + 3144720 commit 13872bd
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as React from 'react';
import styled from 'styled-components';

import logo from '../assets/logo.png';

import SettingsBtn from './settings-button';

interface HeaderProps {
showSettingsModal: () => void;
}

const Container = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 5px;
padding-left: 5px;
margin-bottom: 20px;
`;

const Image = styled.img`
object-fit: center;
cursor: pointer;
`;


const Header = ({ showSettingsModal }: HeaderProps) => {
const handleLogoClick = () => {
window.open("https://synthesisapp.com")
}
return (<Container>
<Image src={logo} alt="Synthesis logo" width={20} onClick={handleLogoClick} />
<SettingsBtn onClick={showSettingsModal} />
</Container>)
};

export default Header;
2 changes: 1 addition & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export { default as Footer } from './footer';
export { default as PauseDigest } from './pause-digest';
export { default as Frequency } from './frequency';
export { default as SummarySettings } from './summary-settings';
export { default as SettingsBtn } from './settings-button';
export { default as Header } from './header';
2 changes: 1 addition & 1 deletion src/components/settings-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const SettingsBtn = ({ onClick }: SettingsBtnProps) => {
return (
<Container>
<Wrapper onClick={onClick}>
<GiSettingsKnobs />
<GiSettingsKnobs style={{ marginRight: 5 }} />
<Text>Settings</Text>
</Wrapper>
</Container>
Expand Down
7 changes: 3 additions & 4 deletions src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
SubscriptionItem,
Footer,
Frequency,
SettingsBtn
Header
} from "../components";
import { FontSize } from "../components/text";
import { FrequencyProvider } from "../contexts/Frequency";
Expand All @@ -25,15 +25,14 @@ const Container = styled.div`

const SubscriptionsContainer = styled.div`
height: 100vh;
padding-top: 50px;
padding-top: 40px;
width: 100vw;
max-width: 500px;
padding-right: 15px;
padding-left: 15px;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-between;
scr`;

const NewSubscribptionButton = styled(Button)`
Expand Down Expand Up @@ -76,14 +75,14 @@ const Home = () => {
<Text>Loading...</Text>
) : subscriptions && subscriptions.length > 0 ? (
<SubscriptionsContainer>
<Header showSettingsModal={showSettingsModal} />
<div>
<Text fontSize={FontSize.lg} align="center" bold>
Your subscriptions
</Text>
<FrequencyProvider>
<Frequency />
</FrequencyProvider>
<SettingsBtn onClick={showSettingsModal} />
<NewSubscribptionButton
label="Add new Subscription"
onClick={showSubscriptionModal}
Expand Down

0 comments on commit 13872bd

Please sign in to comment.