Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Bootcamp tile and Bootcamp components #156

Merged
merged 22 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6f9f262
Fix style.tsx: Remove commented out boxShadow property
ballyalley-o Apr 25, 2024
fd6e65a
TCCPISSUE: Refactor Bootcamp tile and Bootcamp #152 : Add category co…
ballyalley-o Apr 25, 2024
073b3e3
Add category configuration file
ballyalley-o Apr 25, 2024
f247d6c
TCCPISSUE: Refactor Bootcamp tile and Bootcamp #152 : Add new constan…
ballyalley-o Apr 25, 2024
d6dd168
Refactor course.tsx: Add useEffect hook for refetching data on page c…
ballyalley-o Apr 25, 2024
0aacd05
TCCPISSUE: Refactor Bootcamp tile and Bootcamp #152 : Refactor Bootca…
ballyalley-o Apr 25, 2024
030d854
Refactor CourseCard component: Add refetching on page change and upda…
ballyalley-o Apr 25, 2024
7ec4fc3
TCCPISSUE: Refactor Bootcamp tile and Bootcamp #152 : Refactor Dashbo…
ballyalley-o Apr 25, 2024
4c4d8f3
Refactor BootcampTile component: Update imports, use new utility func…
ballyalley-o Apr 25, 2024
1998ebf
Refactor main.ts: Update imports, add new styled components, and use …
ballyalley-o Apr 25, 2024
4f6d07a
Refactor global.d.ts: Add BootcampCardProps and Location interfaces
ballyalley-o Apr 25, 2024
c9a4b62
Add asset-loc.ts file and update index.ts
ballyalley-o Apr 25, 2024
64fa72d
TCCPISSUE: Refactor Bootcamp tile and Bootcamp #152: Refactor Bootcam…
ballyalley-o Apr 25, 2024
15c78fa
TCCPISSUE: Refactor Bootcamp tile and Bootcamp #152: Add new constant…
ballyalley-o Apr 25, 2024
19aa78e
TCCPISSUE: Refactor Bootcamp tile and Bootcamp #152: BootcampCard co…
ballyalley-o Apr 25, 2024
d25f0d8
Add option.tsx file to the dashboard section
ballyalley-o Apr 25, 2024
4e506ee
Refactor Bootcamp tile and Bootcamp #152: Add CardMedia and BadgeImg …
ballyalley-o Apr 25, 2024
8633f84
[Client] TCCPISSUE: Fix form input bug in User Profile #145: Refactor…
ballyalley-o Apr 25, 2024
1386fa2
Add SAVE icon to ICON_WEB in icon-directory.ts
ballyalley-o Apr 25, 2024
8d01ee0
Add FULL_NAME constant to key.ts
ballyalley-o Apr 25, 2024
0b75358
[Client] TCCPISSUE: Fix form input bug in User Profile #145: Refactor…
ballyalley-o Apr 25, 2024
65b7908
Merge pull request #154 from ballyalley-o/bug/TCCP145-fix-form-input-…
ballyalley-o Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading