-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'radiobutton-component' of https://github.com/bluewave-l…
…abs/bluewave-onboarding into radiobutton-component
- Loading branch information
Showing
57 changed files
with
1,326 additions
and
26,219 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
27 changes: 27 additions & 0 deletions
27
frontend/src/components/BannerPageComponents/BannerLeftAppearance/BannerLeftApperance.jsx
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 { React } from 'react'; | ||
import styles from './BannerLeftApperance.module.scss'; | ||
import ColorTextField from '../../ColorTextField/ColorTextField'; | ||
|
||
const BannerLeftAppearance = ({ backgroundColor, setBackgroundColor, fontColor, setFontColor }) => { | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<h2>Background Color</h2> | ||
<div className={styles.color}> | ||
<ColorTextField | ||
value={backgroundColor} | ||
onChange={setBackgroundColor} | ||
/> | ||
</div> | ||
<h2>Font Color</h2> | ||
<div className={styles.color}> | ||
<ColorTextField | ||
value={fontColor} | ||
onChange={setFontColor} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BannerLeftAppearance; |
17 changes: 17 additions & 0 deletions
17
.../src/components/BannerPageComponents/BannerLeftAppearance/BannerLeftApperance.module.scss
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,17 @@ | ||
@use '../../../styles/globals.scss' as *; | ||
|
||
.container{ | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
flex: 1; | ||
h2{ | ||
@include text-style(regular); | ||
margin-top: 1.5rem; | ||
} | ||
.color{ | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
frontend/src/components/BannerPageComponents/BannerLeftContent/BannerLeftContent.jsx
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,34 @@ | ||
import { React } from 'react'; | ||
import styles from './BannerLeftContent.module.scss'; | ||
import DropdownList from '../../DropdownList/DropdownList'; | ||
import { Radio } from "@mui/material"; | ||
import CustomTextField from '../../TextFieldComponents/CustomTextField/CustomTextField'; | ||
|
||
const BannerLeftContent = ({ setIsTopPosition, url, setUrl }) => { | ||
const handleSetUrl = (event) => { | ||
setUrl(event.target.value); | ||
}; | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<h2>Action</h2> | ||
<DropdownList actions={['No action', 'Open a URL', 'Open a URL in a new page']} /> | ||
<h2>Position</h2> | ||
<div className={styles.radioContent}> | ||
<Radio onClick={() => setIsTopPosition(true)} /> | ||
<h3>Top (centered)</h3> | ||
</div> | ||
<div className={styles.radioContent}> | ||
<Radio onClick={() => setIsTopPosition(false)} /> | ||
<h3>Bottom (centered)</h3> | ||
</div> | ||
<h2 style={{ marginBottom: 0 }}>URL</h2> | ||
<CustomTextField | ||
TextFieldWidth='241px' | ||
value={url} | ||
onChange={handleSetUrl} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BannerLeftContent; |
19 changes: 19 additions & 0 deletions
19
frontend/src/components/BannerPageComponents/BannerLeftContent/BannerLeftContent.module.scss
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,19 @@ | ||
@use '../../../styles/globals.scss' as *; | ||
|
||
.container{ | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
flex: 1; | ||
h2{ | ||
@include text-style(regular); | ||
margin-top: 1.5rem; | ||
} | ||
h3{ | ||
@include text-style(regular); | ||
} | ||
.radioContent{ | ||
display: flex; | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
frontend/src/components/BannerPageComponents/BannerPreview/BannerPreview.jsx
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,43 @@ | ||
import styles from './BannerPreview.module.scss' | ||
import { React } from 'react'; | ||
import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined'; | ||
|
||
const BannerPreview = ({ bannerText = '', | ||
setBannerText = () => null, | ||
backgroundColor = 'var(--light-purple-background)', | ||
color = 'var(--main-text-color)', | ||
isTopPosition = true }) => { | ||
|
||
const handleChange = (event) => { | ||
setBannerText(event.target.value); | ||
}; | ||
const banner = ( | ||
<div className={styles.banner} style={{ backgroundColor: backgroundColor, color: color }}> | ||
<span /> | ||
<input | ||
type="text" | ||
className={styles.bannertext} | ||
placeholder="Change the Banner Text Here" | ||
value={bannerText} | ||
onChange={handleChange} | ||
style={{color: color}} | ||
/> | ||
<CloseOutlinedIcon style={{ color: color, fontSize: '20px' }} /> | ||
</div> | ||
); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<h2>Preview</h2> | ||
<div className={styles.preview}> | ||
{isTopPosition && banner} | ||
<div className={styles.bannerOne}></div> | ||
<div className={styles.bannerTwo}></div> | ||
<div className={styles.bannerThree}></div> | ||
{!isTopPosition && banner} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BannerPreview; |
70 changes: 70 additions & 0 deletions
70
frontend/src/components/BannerPageComponents/BannerPreview/BannerPreview.module.scss
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,70 @@ | ||
@use '../../../styles/globals.scss' as *; | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-top: 1.5rem; | ||
margin-left: 3rem; | ||
margin-right: 3rem; | ||
flex: 2; | ||
|
||
.bannertext { | ||
border: none; | ||
background: transparent; | ||
width: 100%; | ||
text-align: center; | ||
} | ||
|
||
.bannertext:focus { | ||
outline: none | ||
} | ||
|
||
.preview { | ||
border-radius: 10px; | ||
border: 1.23px solid var(--grey-border); | ||
width: 100%; | ||
padding: 1rem 1.5rem; | ||
} | ||
|
||
h2 { | ||
@include text-style(regular); | ||
margin-bottom: 0.7rem; | ||
margin-top: 0; | ||
} | ||
|
||
.banner { | ||
@include text-style(regular); | ||
background-color: var(--light-purple-background); | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0.7rem; | ||
border-radius: 5px; | ||
} | ||
|
||
.bannerOne, | ||
.bannerTwo, | ||
.bannerThree { | ||
background-color: #F3F3F3; | ||
border-radius: 5px; | ||
margin-bottom: 1rem; | ||
|
||
} | ||
|
||
.bannerOne { | ||
width: 40%; | ||
height: 2rem; | ||
margin-top: 1rem; | ||
} | ||
|
||
.bannerTwo { | ||
width: 80%; | ||
height: 5rem; | ||
} | ||
|
||
.bannerThree { | ||
width: 80%; | ||
height: 3rem; | ||
} | ||
} |
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 { React } from 'react'; | ||
import CustomTextField from '../TextFieldComponents/CustomTextField/CustomTextField'; | ||
import CircleIcon from '@mui/icons-material/Circle'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const ColorTextField = ({onChange = () => null, value = null}) => { | ||
const handleColor = (event) => { | ||
let newText = event.target.value; | ||
if (!newText.startsWith('#')) { | ||
newText = '#' + newText; | ||
} | ||
onChange(newText); | ||
|
||
} | ||
return ( | ||
<> | ||
<CustomTextField | ||
TextFieldWidth="100%" | ||
value={value} | ||
onChange={handleColor} | ||
/> | ||
<CircleIcon style={{ fontSize: '24px', color: value, marginLeft: '10px' }} /> | ||
</> | ||
) | ||
} | ||
|
||
export default ColorTextField; |
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
flex-direction: column; | ||
} | ||
|
||
|
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,34 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import './CustomLabelTagStyles.css'; | ||
|
||
const VALID_BACKGROUND_COLORS = ['orange', 'gray', 'purple', 'green', 'seen', 'waiting', 'new']; | ||
|
||
const CustomLabelTag = ({ | ||
text, | ||
backgroundColor = 'white', | ||
textColor = '', | ||
className = '' | ||
}) => { | ||
const labelClass = `label label-${backgroundColor} ${className}`; | ||
|
||
const style = { | ||
color: textColor, | ||
}; | ||
|
||
return ( | ||
<span className={labelClass} style={style}> | ||
{['seen', 'waiting', 'new'].includes(backgroundColor) && <span className="dot"></span>} | ||
{text} | ||
</span> | ||
); | ||
}; | ||
|
||
CustomLabelTag.propTypes = { | ||
text: PropTypes.string.isRequired, | ||
backgroundColor: PropTypes.oneOf(VALID_BACKGROUND_COLORS), | ||
textColor: PropTypes.string, | ||
className: PropTypes.string, | ||
}; | ||
|
||
export default CustomLabelTag; |
Oops, something went wrong.