-
Notifications
You must be signed in to change notification settings - Fork 73
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
171 changed files
with
5,972 additions
and
1,112 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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
.background { | ||
position: absolute; | ||
} | ||
|
||
.banner { | ||
position: relative; | ||
} | ||
|
||
.password { | ||
position: relative; | ||
top: -80px; | ||
} | ||
|
||
.header { | ||
padding-top: 40px; | ||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | ||
font-style: normal; | ||
font-weight: 800; | ||
font-size: 24px; | ||
line-height: 33px; | ||
color: #5B34EA; | ||
} | ||
|
||
body { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
.container { | ||
text-align: center; | ||
width: 640px; | ||
font-family: 'Manrope'; | ||
font-style: normal; | ||
font-weight: 400; | ||
font-size: 14px; | ||
line-height: 19px; | ||
text-align: center; | ||
color: #777683; | ||
|
||
.reset-password-button { | ||
border-radius: 20px; | ||
background: #5B34EA; | ||
text-align: center; | ||
display: inline-block; | ||
|
||
a { | ||
width: 129px; | ||
height: 24px; | ||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | ||
font-weight: 700; | ||
font-size: 12px; | ||
line-height: 16px; | ||
color: #FFFFFF; | ||
text-decoration: none; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
} | ||
} | ||
|
||
.footer-container { | ||
justify-content: center; | ||
display: flex; | ||
|
||
#footer { | ||
width: 640px; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import axios from "./api"; | ||
|
||
const path = "/expenses"; | ||
|
||
const index = async () => await axios.get(path); | ||
|
||
const create = async payload => await axios.post(path, payload); | ||
|
||
const show = async id => await axios.get(`${path}/${id}`); | ||
|
||
const update = async (id, payload) => axios.patch(`${path}/${id}`, payload); | ||
|
||
const destroy = async id => axios.delete(`${path}/${id}`); | ||
|
||
const createCategory = async payload => | ||
axios.post("/expense_categories", payload); | ||
|
||
const expensesApi = { | ||
index, | ||
create, | ||
show, | ||
update, | ||
destroy, | ||
createCategory, | ||
}; | ||
|
||
export default expensesApi; |
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
138 changes: 138 additions & 0 deletions
138
app/javascript/src/common/CustomCreatableSelect/index.tsx
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,138 @@ | ||
/* eslint-disable import/exports-last */ | ||
import React from "react"; | ||
|
||
import CreatableSelect from "react-select/creatable"; | ||
|
||
import { | ||
customErrStyles, | ||
customStyles, | ||
CustomValueContainer, | ||
} from "common/CustomReactSelectStyle"; | ||
import { useUserContext } from "context/UserContext"; | ||
|
||
type CustomCreatableSelectProps = { | ||
id?: string; | ||
styles?: any; | ||
components?: any; | ||
classNamePrefix?: string; | ||
label?: string; | ||
isErr?: any; | ||
isSearchable?: boolean; | ||
isDisabled?: boolean; | ||
ignoreDisabledFontColor?: boolean; | ||
hideDropdownIndicator?: boolean; | ||
handleOnClick?: (e?: any) => void; // eslint-disable-line | ||
handleOnChange?: (e?: any) => void; // eslint-disable-line | ||
handleonFocus?: (e?: any) => void; // eslint-disable-line | ||
onBlur?: (e?: any) => void; // eslint-disable-line | ||
defaultValue?: object; | ||
onMenuClose?: (e?: any) => void; // eslint-disable-line | ||
onMenuOpen?: (e?: any) => void; // eslint-disable-line | ||
className?: string; | ||
autoFocus?: boolean; | ||
value?: object; | ||
getOptionLabel?: (e?: any) => any; // eslint-disable-line | ||
wrapperClassName?: string; | ||
options?: Array<any>; | ||
name?: string; | ||
}; | ||
|
||
export const CustomCreatableSelect = ({ | ||
id, | ||
isSearchable, | ||
classNamePrefix, | ||
options, | ||
label, | ||
handleOnChange, | ||
handleonFocus, | ||
handleOnClick, | ||
name, | ||
value, | ||
isErr, | ||
isDisabled, | ||
styles, | ||
components, | ||
onMenuClose, | ||
onMenuOpen, | ||
ignoreDisabledFontColor, | ||
hideDropdownIndicator, | ||
className, | ||
autoFocus, | ||
onBlur, | ||
defaultValue, | ||
getOptionLabel, | ||
wrapperClassName, | ||
}: CustomCreatableSelectProps) => { | ||
const { isDesktop } = useUserContext(); | ||
|
||
const getStyle = () => { | ||
if (isErr) { | ||
return customErrStyles(isDesktop); | ||
} | ||
|
||
return customStyles( | ||
isDesktop, | ||
ignoreDisabledFontColor, | ||
hideDropdownIndicator | ||
); | ||
}; | ||
|
||
return ( | ||
<div | ||
className={`outline relative ${wrapperClassName}`} | ||
onClick={handleOnClick} | ||
> | ||
<CreatableSelect | ||
autoFocus={autoFocus} | ||
className={className} | ||
classNamePrefix={classNamePrefix} | ||
defaultValue={defaultValue} | ||
getOptionLabel={getOptionLabel} | ||
id={id || name} | ||
isDisabled={isDisabled} | ||
isSearchable={isSearchable} | ||
name={name} | ||
options={options} | ||
placeholder={label} | ||
styles={styles || getStyle()} | ||
value={value} | ||
components={{ | ||
...components, | ||
ValueContainer: CustomValueContainer, | ||
IndicatorSeparator: () => null, | ||
}} | ||
onBlur={onBlur} | ||
onChange={handleOnChange} | ||
onFocus={handleonFocus} | ||
onMenuClose={onMenuClose} | ||
onMenuOpen={onMenuOpen} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
CustomCreatableSelect.defaultProps = { | ||
id: "", | ||
styles: null, | ||
components: null, | ||
classNamePrefix: "react-select-filter", | ||
label: "Select", | ||
isErr: false, | ||
isSearchable: true, | ||
isDisabled: false, | ||
ignoreDisabledFontColor: false, | ||
hideDropdownIndicator: false, | ||
handleOnClick: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function | ||
handleOnChange: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function | ||
handleonFocus: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function | ||
onBlur: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function | ||
defaultValue: null, | ||
onMenuClose: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function | ||
onMenuOpen: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function | ||
className: "", | ||
autoFocus: false, | ||
value: null, | ||
wrapperClassName: "", | ||
}; | ||
|
||
export default CustomCreatableSelect; |
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.