Skip to content

Commit

Permalink
Merge pull request #8 from CNU-OOHub/feat/#5-signup
Browse files Browse the repository at this point in the history
refactor: add text atom
  • Loading branch information
leecr1215 authored Oct 17, 2022
2 parents 5716971 + 141aa7b commit c2c23e2
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
39 changes: 39 additions & 0 deletions src/components/atoms/text.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from "react";

const Text = ({
children,
fontSize = 1.2,
fontWeight = "normal",
color = "black",
marginTop = "0vh",
onClick,
}) => {
return onClick ? (
<button
type="button"
style={{
fontSize: `${fontSize}rem`,
fontWeight: fontWeight,
fontFamily: "inter",
color: color,
}}
onClick={onClick}
>
{children}
</button>
) : (
<span
style={{
fontSize: `${fontSize}rem`,
fontWeight: fontWeight,
color: color,
marginTop: marginTop,
fontFamily: "inter",
}}
>
{children}
</span>
);
};

export default Text;
4 changes: 3 additions & 1 deletion src/components/molecules/flexColumn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ const Container = styled.div`
padding-left: ${(props) => `${props.horizontalPadding}rem`};
padding-right: ${(props) => `${props.horizontalPadding}rem`};
align-content: center;
text-align: center;
vertical-align: middle;
`;

const FlexColumn = ({
children,
justifyContent = "space-between",
verticalPadding = 0,
horizontalPadding = 0,
height = 85,
height = 100,
width = 25,
}) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import theme from "../../styles/theme";

const Head = styled.div`
width: 100%;
height: 5em;
height: 8vh;
background-color: ${theme.primaryColor};
`;

Expand Down
15 changes: 14 additions & 1 deletion src/components/pages/signUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import Input from "../atoms/input";
import FlexColumn from "../molecules/flexColumn";
import { useNavigate } from "react-router-dom";
import Header from "../organisms/header";
import Text from "../atoms/text";
import theme from "../../styles/theme";

const Logo = styled.img`
width: 20rem;
Expand Down Expand Up @@ -59,7 +61,7 @@ const SignUp = () => {
};

return (
<div style={{ height: "100vh" }}>
<div style={{ height: "92vh" }}>
<FlexColumn justifyContent="space-evenly" width={25}>
<Logo src={logo} alt="oohub" />
<Input
Expand Down Expand Up @@ -99,6 +101,17 @@ const SignUp = () => {
>
Sign Up
</Button>
<div>
<Text>Do you have an account? </Text>
<Text
onClick={() => {
navigate("/logIn");
}}
color={theme.primaryColor}
>
SIGNIN!
</Text>
</div>
</FlexColumn>
</div>
);
Expand Down

0 comments on commit c2c23e2

Please sign in to comment.