-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
18 changed files
with
3,132 additions
and
1,087 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,170 @@ | ||
@import url("https://fonts.googleapis.com/css2?family=Passion+One&family=Roboto:wght@400;500;900&display=swap"); | ||
|
||
.App { | ||
color: white; | ||
text-align: center; | ||
color: white; | ||
text-align: center; | ||
} | ||
|
||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
html, | ||
body { | ||
height: 100%; | ||
min-width: 250px; | ||
min-height: 650px; | ||
} | ||
|
||
.container { | ||
width: 15rem; | ||
height: 15rem; | ||
background-color: green; | ||
width: 100%; | ||
height: 100%; | ||
background-color: #358410; | ||
} | ||
|
||
/* http://meyerweb.com/eric/tools/css/reset/ | ||
v2.0 | 20110126 | ||
License: none (public domain) | ||
*/ | ||
|
||
html, | ||
body, | ||
div, | ||
span, | ||
applet, | ||
object, | ||
iframe, | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6, | ||
p, | ||
blockquote, | ||
pre, | ||
a, | ||
abbr, | ||
acronym, | ||
address, | ||
big, | ||
cite, | ||
code, | ||
del, | ||
dfn, | ||
em, | ||
img, | ||
ins, | ||
kbd, | ||
q, | ||
s, | ||
samp, | ||
small, | ||
strike, | ||
strong, | ||
sub, | ||
sup, | ||
tt, | ||
var, | ||
b, | ||
u, | ||
i, | ||
center, | ||
dl, | ||
dt, | ||
dd, | ||
ol, | ||
ul, | ||
li, | ||
fieldset, | ||
form, | ||
label, | ||
legend, | ||
table, | ||
caption, | ||
tbody, | ||
tfoot, | ||
thead, | ||
tr, | ||
th, | ||
td, | ||
article, | ||
aside, | ||
canvas, | ||
details, | ||
embed, | ||
figure, | ||
figcaption, | ||
footer, | ||
header, | ||
hgroup, | ||
menu, | ||
nav, | ||
output, | ||
ruby, | ||
section, | ||
summary, | ||
time, | ||
mark, | ||
audio, | ||
video { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
font-size: 100%; | ||
font: inherit; | ||
vertical-align: baseline; | ||
} | ||
|
||
/* HTML5 display-role reset for older browsers */ | ||
article, | ||
aside, | ||
details, | ||
figcaption, | ||
figure, | ||
footer, | ||
header, | ||
hgroup, | ||
menu, | ||
nav, | ||
section { | ||
display: block; | ||
} | ||
|
||
body { | ||
line-height: 1; | ||
} | ||
|
||
ol, | ||
ul { | ||
list-style: none; | ||
} | ||
|
||
blockquote, | ||
q { | ||
quotes: none; | ||
} | ||
|
||
blockquote:before, | ||
blockquote:after, | ||
q:before, | ||
q:after { | ||
content: ""; | ||
content: none; | ||
} | ||
|
||
table { | ||
border-collapse: collapse; | ||
border-spacing: 0; | ||
} | ||
|
||
} | ||
p { | ||
font-family: "Roboto", sans-serif; | ||
letter-spacing: 0.2px; | ||
line-height: 25px; | ||
color: white; | ||
} | ||
|
||
.secondary { | ||
font-family: "Passion One", cursive; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
import React from "react"; | ||
import Logo from "./assets/flatini-logo.png"; | ||
import "./App.css"; | ||
import { Routes, Route, useNavigate } from "react-router-dom"; | ||
import { Landing } from "./Landing"; | ||
import styled from "styled-components"; | ||
import CreateGroup from "./CreateGroup"; | ||
import { Flats } from "./Flats"; | ||
|
||
const Header = styled.div``; | ||
|
||
function App() { | ||
return <div className="App">Hello World5</div>; | ||
const navigate = useNavigate(); | ||
function gotoLanding(): void { | ||
navigate("/"); | ||
} | ||
|
||
return ( | ||
<> | ||
<Header style={{ cursor: "pointer" }} onClick={gotoLanding}> | ||
<img style={{ width: 110 }} src={Logo} /> | ||
</Header> | ||
<Routes> | ||
<Route path="/" element={<Landing />} /> | ||
<Route path="/Flats" element={<Flats />} /> | ||
<Route path="/CreateGroup" element={<CreateGroup />} /> | ||
</Routes> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React, { MouseEventHandler } from "react"; | ||
import styled from "styled-components"; | ||
|
||
const Wrapper = styled.a` | ||
background-color: white; | ||
color: #322848; | ||
padding: 20px; | ||
border-radius: 10px; | ||
font-size: 25px; | ||
border: 0; | ||
cursor: pointer; | ||
&::-moz-focus-inner, | ||
&::-moz-focus-inner { | ||
border: 0; | ||
padding: 0; | ||
} | ||
`; | ||
|
||
type Props = { | ||
onClick?: MouseEventHandler<HTMLAnchorElement> | undefined; | ||
children?: React.ReactNode; | ||
style?: React.CSSProperties | undefined; | ||
}; | ||
|
||
const Button = (props: Props) => { | ||
return ( | ||
<Wrapper onClick={props.onClick} style={props.style} className="secondary"> | ||
{props.children} | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { useState } from "react"; | ||
import styled from "styled-components"; | ||
import Button from "./Button"; | ||
|
||
const Wrapper = styled.div` | ||
position: fixed; | ||
height: 100%; | ||
width: 100%; | ||
top: 0; | ||
left: 0; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
text-align: center; | ||
padding: 50px 20px; | ||
`; | ||
|
||
const Hashtag = styled.span` | ||
font-size: 11px; | ||
color: white; | ||
`; | ||
|
||
const CopyCodeWrapper = styled.div` | ||
flex: 8; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
`; | ||
|
||
const GroupCode = styled.span` | ||
font-size: 45px; | ||
color: white; | ||
`; | ||
|
||
const LinkCopiedText = styled.div` | ||
background-color: #4b2798; | ||
color: white; | ||
padding: 10px 30px; | ||
border-radius: 5px; | ||
font-size: 20px; | ||
`; | ||
|
||
const CreateGroup = () => { | ||
const [id, setId] = useState(generateRandomId()); | ||
const [copiedToClipboard, setCopiedToClipboard] = useState(false); | ||
|
||
function generateRandomId(): string { | ||
let randomId = ""; | ||
for (let i = 0; i < 12; i++) { | ||
randomId += Math.floor(Math.random() * 10).toString(); | ||
} | ||
return randomId; | ||
} | ||
|
||
return ( | ||
<Wrapper> | ||
<p style={{ flex: 1 }}> | ||
You are creating a new group. Share this code with your flatmates so | ||
they can join the group. | ||
</p> | ||
|
||
<CopyCodeWrapper> | ||
<div> | ||
<Hashtag>#</Hashtag> | ||
<GroupCode className="secondary">{id}</GroupCode> | ||
</div> | ||
{copiedToClipboard ? ( | ||
<LinkCopiedText style={{ margin: "20px 0" }}> | ||
<span className="secondary">Code copied to clipboard!</span> | ||
</LinkCopiedText> | ||
) : null} | ||
<Button | ||
onClick={() => setCopiedToClipboard(true)} | ||
style={{ padding: 15, marginTop: 10 }} | ||
> | ||
{!copiedToClipboard ? ( | ||
<img | ||
style={{ width: 30 }} | ||
src="https://cdns.iconmonstr.com/wp-content/releases/preview/7.8.0/240/iconmonstr-cut-lined.png" | ||
/> | ||
) : ( | ||
<img | ||
style={{ width: 30 }} | ||
src="https://cdns.iconmonstr.com/wp-content/releases/preview/2012/240/iconmonstr-check-mark-4.png" | ||
/> | ||
)} | ||
</Button> | ||
</CopyCodeWrapper> | ||
<div style={{ flex: 1 }}> | ||
<Button>Create new group</Button> | ||
</div> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default CreateGroup; |
Oops, something went wrong.