Skip to content

Commit

Permalink
Merge pull request #156 from ballyalley-o/development
Browse files Browse the repository at this point in the history
Refactor Bootcamp tile and Bootcamp components
  • Loading branch information
ballyalley-o authored Apr 25, 2024
2 parents c086bbe + 65b7908 commit 72513b9
Show file tree
Hide file tree
Showing 28 changed files with 610 additions and 325 deletions.
62 changes: 45 additions & 17 deletions src/component/form/form-field/form-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface ExtendedFormFieldProps extends FormFieldProps {
errors?: any
helperText?: string
defaultValue?: string
isAccount?: boolean
disabled?: boolean
setValue?: (value: string) => void
}

Expand All @@ -37,6 +39,8 @@ const FormField = forwardRef(
helperText,
isGithub,
errors,
isAccount = false,
disabled = false,
required = false
}: ExtendedFormFieldProps,
ref
Expand All @@ -56,10 +60,10 @@ const FormField = forwardRef(

return (
<TextField
variant='filled'
variant={isAccount ? 'outlined' : 'filled'}
color='primary'
autoComplete={autoComplete}
disabled={submitting || sent}
disabled={submitting || sent || disabled}
label={label}
placeholder={placeholder}
type={showPassword ? type : isPassword ? KEY.PASSWORD : type}
Expand Down Expand Up @@ -95,26 +99,50 @@ const FormField = forwardRef(
fullWidth
{...register(name)}
sx={{
color: 'common.white',
'& .MuiFilledInput-root': {
color: 'common.black',
backgroundColor: 'common.white',
'& .MuiInputLabel-root': {
...(!isAccount && {
color: 'common.white',
'& .MuiFilledInput-root': {
color: 'common.black',
backgroundColor: 'common.white',
'& .MuiInputLabel-root': {
color: 'common.white'
},
'&.Mui-focused .MuiInputBase-input': {
color: 'common.black'
},
'&.Mui-focused': {
backgroundColor: 'secondary.main'
},
'&:hover': {
backgroundColor: 'secondary.main'
}
},
'&:active': {
color: 'common.white'
}
}),
// if isAccount is true, then apply the following styles
...(isAccount && {
'& .MuiOutlinedInput-notchedOutline': {
border: 'none',
fontWeight: 'bold'
},
'&.Mui-focused': {
backgroundColor: 'transparent'
},
'&.Mui-focused .MuiInputBase-input': {
// edit label color
'& .MuiInputLabel-root': {
color: 'common.black'
},
'&.Mui-focused': {
backgroundColor: 'secondary.main'
// disabled text color
'& .MuiInputBase-input ': {
color: 'grey.800',
opacity: 1,
fontWeight: 'bold'
},
'&:hover': {
backgroundColor: 'secondary.main'
}
},
'&:active': {
color: 'common.white'
},
backgroundColor: 'transparent',
fontWeight: 'bold'
}),
padding: 1,
marginY: 1
}}
Expand Down
1 change: 0 additions & 1 deletion src/component/setting/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const SCard = styled(CardActionArea, {
border: `solid 1px ${alpha(theme.palette.grey[800], 0.22)}`,
...(selected && {
color: theme.palette.primary.main,
// boxShadow: theme.customShadow.z12,
borderColor: alpha(theme.palette.grey[800], 0.22)
})
}))
7 changes: 7 additions & 0 deletions src/config/category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const CATEGORY = {
GENERAL: 'General',
AI_DIGITAL_TRANSFORMATION: 'AI & Digital Transformation',
SUSTAINABILITY: 'Sustainability',
LEADERSHIP_INTERPERSONAL_SKILLS: 'Leadership & Interpersonal Skills',
DATABASES: 'Databases'
}
2 changes: 2 additions & 0 deletions src/config/icon-directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const ICON_WEB = {
MODE_LIGHT: _getWebIcon('sun'),
MODE_DARK: _getWebIcon('moon'),

SAVE: _getWebIcon('save-outline'),
SUCCESS: _getWebIcon('checkmark-circle-2'),
SETTING: _getWebIcon('cog'),
WARNING: _getWebIcon('alert-triangle'),
Expand Down Expand Up @@ -87,6 +88,7 @@ export enum ICON_WEB_NAME {
FULLSCREEN_EXIT = 'FULLSCREEN_EXIT',
REFRESH = 'REFRESH',

SAVE = 'SAVE',
SUCCESS = 'SUCCESS',
SETTING = 'SETTING',
WARNING = 'WARNING',
Expand Down
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { default as GLOBAL } from './global'
export { default as ASSET } from './asset-directory'
export * from './icon-directory'
export * from './dimension'
export * from './category'
4 changes: 3 additions & 1 deletion src/constant/aria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ enum ARIA {
NEW_PASSWORD = 'new-password',
FIRST_NAME = 'First name',
LAST_NAME = 'Last name',
TOGGLE_PASSWORD = 'toggle password visibility'
TOGGLE_PASSWORD = 'toggle password visibility',
TABS = 'tabs',
COMPANY_BADGE = 'company badge'
}

export default ARIA
3 changes: 2 additions & 1 deletion src/constant/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ enum BUTTON {
// @auth
LOG_IN = 'Log In',
LOG_OUT = 'Log Out',
REGISTER = 'Register'
REGISTER = 'Register',
START_APPLICATION = ' Start your Application'
}

export { BUTTON }
14 changes: 14 additions & 0 deletions src/constant/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export enum COMPONENT {
GS_LOADING_BUTTON = 'GSLoadingButton',
S_TOOLBAR = 'SToolbar',
S_BADGE_HEADER = 'SBadgeHeader',
S_CARD = 'SCard',
S_SCROLL_BOX = 'SScrollBox',
S_SCROLL_GRID = 'SScrollGrid',
GS_CONTAINER_GRID = 'GSContainerGrid',
SECTION = 'section',
GRID = 'Grid',
DIV = 'div',
IMG = 'img',
A = 'a'
}
3 changes: 3 additions & 0 deletions src/constant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ export { BUTTON } from './button'
export * from './typography'
export * from './size'
export * from './color'
export * from './component'
export * from './variant'
export * from './sx'
6 changes: 5 additions & 1 deletion src/constant/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enum KEY {
PHOTO_DEFAULT = 'no-photo.jpeg',
BADGE_DEFAULT = 'no-badge.png',
// @form
FULL_NAME = 'fullname',
FIRST_NAME = 'firstname',
LAST_NAME = 'lastname',
EMAIL = 'email',
Expand All @@ -28,6 +29,7 @@ enum KEY {
TEXT = 'text',
AUTO = 'auto',
END = 'end',
IMAGE = 'img',
// modes
LIGHT = 'light',
DARK = 'dark',
Expand All @@ -43,7 +45,9 @@ enum KEY {
TOP = 'top',
BOTTOM = 'bottom',
LEFT = 'left',
RIGHT = 'right'
RIGHT = 'right',
HORIZONTAL = 'horizontal',
VERTICAL = 'vertical'
}

export default KEY
4 changes: 3 additions & 1 deletion src/constant/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const LABEL = {
TRAINER: 'Trainer',

BOOTCAMP_PAGE_TITLE: 'Worldclass Bootcamps Worldwide',
COURSE_PAGE_TITLE: 'World Class Courses'
COURSE_PAGE_TITLE: 'World Class Courses',

NEW_BOOTCAMPS: 'New Bootcamps'
}

export default LABEL
5 changes: 5 additions & 0 deletions src/constant/placeholder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ enum PLACEHOLDER {
COUNTRY = 'Country',
ZIP_CODE = 'Zip Code',

BOOTCAMP_NAME = 'TCCP Exclusive',
NO_DURATION = 'No duration specified',
NO_TUITION = 'No tuition specified',
NO_MINIMUM_SKILL = 'No minimum skill required',

// @bootcamp search form
MILES_FROM = 'Miles From',
ENTER_ZIPCODE = 'Enter Zipcode',
Expand Down
13 changes: 13 additions & 0 deletions src/constant/sx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export enum FLEX {
FLEX = 'flex',
INLINE_FLEX = 'inline-flex',
FLEX_ROW = 'row',
FLEX_COLUMN = 'column',
FLEX_ROW_REVERSE = 'row-reverse',
FLEX_COLUMN_REVERSE = 'column-reverse',
FLEX_WRAP = 'wrap',
FLEX_NOWRAP = 'nowrap',
FLEX_WRAP_REVERSE = 'wrap-reverse',
FLEX_END = 'flex-end',
FLEX_START = 'flex-start'
}
33 changes: 33 additions & 0 deletions src/constant/variant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export enum BUTTON_VARIANT {
CONTAINED = 'contained',
OUTLINED = 'outlined',
TEXT = 'text'
}

export enum TYPOGRAPHY_VARIANT {
H1 = 'h1',
H2 = 'h2',
H3 = 'h3',
H4 = 'h4',
H5 = 'h5',
H6 = 'h6',
SUBTITLE1 = 'subtitle1',
SUBTITLE2 = 'subtitle2',
BODY1 = 'body1',
BODY2 = 'body2',
CAPTION = 'caption',
OVERLINE = 'overline'
}

export enum SKELETON_VARIANT {
RECTANGULAR = 'rectangular',
CIRCULAR = 'circular',
TEXT = 'text'
}

export enum VARIANT {
RECTANGULAR = 'rectangular',
CIRCULAR = 'circular',
OUTLINED = 'outlined',
COVER = 'cover'
}
Loading

0 comments on commit 72513b9

Please sign in to comment.