-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
801 additions
and
314 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,13 +1,13 @@ | ||
import RestClient from "./RestClient"; | ||
|
||
export default class ContactApi { | ||
restClient: RestClient; | ||
public restClient: RestClient; | ||
|
||
constructor(restClient: RestClient) { | ||
this.restClient = restClient; | ||
} | ||
|
||
saveContact(json: object, succussed: (res: object) => void, errored: (err: object) => void, always = () => {}) { | ||
public saveContact(json: object, succussed: (res: object) => void, errored: (err: object) => void, always = () => {}) { | ||
return this.restClient.post("/api/v1/contacts", json, succussed, errored, always); | ||
} | ||
} |
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,17 +1,72 @@ | ||
import styled from "styled-components"; | ||
import * as React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import styled, { css } from "styled-components"; | ||
|
||
import { chkColors } from "./color"; | ||
|
||
export const ChkButtonBase = styled.div` | ||
interface IPropsCss { | ||
color?: string; | ||
bgcolor?: string; | ||
border?: string; | ||
} | ||
|
||
interface IPropsChkButtonBase extends IPropsCss { | ||
to?: string; | ||
text: string | React.ReactNode; | ||
name?: string; | ||
} | ||
|
||
const ChkButtonBase = (props: IPropsChkButtonBase) => { | ||
const { to, text, name } = props; | ||
const { color, bgcolor, border } = props; | ||
|
||
if (to) { | ||
if (to.startsWith("http")) { | ||
return ( | ||
<ATag color={color} bgcolor={bgcolor} border={border} href={to}> | ||
{text} | ||
</ATag> | ||
); | ||
} else { | ||
return ( | ||
<LinkTag color={color} bgcolor={bgcolor} border={border} to={to}> | ||
{text} | ||
</LinkTag> | ||
); | ||
} | ||
} else { | ||
return ( | ||
<ButtonTag name={name} color={color} bgcolor={bgcolor} border={border}> | ||
{text} | ||
</ButtonTag> | ||
); | ||
} | ||
}; | ||
|
||
const ButtonStyle = css` | ||
display: block; | ||
color: white; | ||
width: 100%; | ||
margin: 0; | ||
padding: 10px; | ||
outline: none; | ||
border-style: none; | ||
box-shadow: 4px 3px 10px 0px ${chkColors.shadow}; | ||
border-radius: 20px; | ||
text-align: center; | ||
margin: 0; | ||
padding: 10px; | ||
width: 100%; | ||
line-height: 1.5rem; | ||
border-radius: 1.5rem; | ||
background-color: ${chkColors.orange}; | ||
color: ${(props: IPropsCss) => (props.color ? chkColors[props.color] : chkColors.white)}; | ||
border: ${(props: IPropsCss) => (props.border ? `2px solid ${chkColors[props.border]}` : "none")}; | ||
background-color: ${(props: IPropsCss) => (props.bgcolor ? chkColors[props.bgcolor] : chkColors.orange)}; | ||
`; | ||
|
||
const ButtonTag = styled.button` | ||
${ButtonStyle} | ||
`; | ||
|
||
const LinkTag = styled(Link)` | ||
${ButtonStyle} | ||
`; | ||
|
||
const ATag = styled.a` | ||
${ButtonStyle} | ||
`; | ||
|
||
export default ChkButtonBase; |
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,10 +1,16 @@ | ||
export const chkColors = { | ||
interface IColor { | ||
[key: string]: string; | ||
} | ||
|
||
export const chkColors: IColor = { | ||
orange: "#edb600", | ||
blue: "#66C9DB", | ||
skyblue: "#A8E1E3", | ||
black: "#565A62", | ||
gray: "#7f8287", | ||
shadow: "#14141433", | ||
white: "#ffffff", | ||
placeholder: "#b0bec5" | ||
placeholder: "#b0bec5", | ||
aqua: "#b3dfe2", | ||
darkenAqua: "#50AAB7" | ||
}; |
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
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
Oops, something went wrong.