Skip to content

Commit

Permalink
feat: add title bar
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewinci committed Mar 14, 2023
1 parent f903a42 commit e724381
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from '@emotion/styled'

export const Button = styled.button`
font-family: virgil;
padding: 10px;
padding: 3px;
background-color: #ffffff;
font-size: 20px;
border-radius: 4px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./button";
export * from "./typography";
export * from "./title-bar";
18 changes: 18 additions & 0 deletions src/components/title-bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styled from "@emotion/styled";
import { floppy, sword } from "../icons";

export const Title = styled.h1`
font-family: virgil;
font-weight: bolder;
font-size: 2.em;
margin: 2px;
text-align: center;
`

export const TitleBar = () => {
return <div style={{ display: "flex", justifyContent: "center", paddingBottom: "15px", paddingTop: "5px" }}>
<img style={{ width: "25px", marginRight: "10px" }} src={sword} />
<Title>Excalistore</Title>
<img style={{ width: "35px", marginLeft: "10px" }} src={floppy} />
</div>
}
8 changes: 0 additions & 8 deletions src/components/typography.tsx

This file was deleted.

16 changes: 16 additions & 0 deletions src/icons/floppy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/icons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import floppy from "./floppy.svg";
import sword from "./sword.svg";
export { floppy, sword };
16 changes: 16 additions & 0 deletions src/icons/sword.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import { Global } from '@emotion/react'
import React from 'react'
import ReactDOM from 'react-dom/client'
import { Button, Title } from './components'
import { GlobalStyles } from './fonts'
import { Button, TitleBar } from './components'
import { GlobalStyles } from './style'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<Global styles={GlobalStyles} />
<Title>Hello!</Title>
<TitleBar />
<Button>This is a test</Button>
</React.StrictMode>,
)
File renamed without changes.
11 changes: 11 additions & 0 deletions src/fonts/index.ts → src/style/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { css } from "@emotion/react";
// global styles
import virgil from "./Virgil.woff2";

export const GlobalStyles = css`
@font-face {
font-family: "virgil";
src: url(${virgil}) format("woff2");
}
html {
min-width: 600px;
max-width: 600px;
min-height: 450px;
max-height: 450px;
border-radius: 1em;
font-family: virgil;
}
`;

0 comments on commit e724381

Please sign in to comment.