Skip to content

Commit

Permalink
Merge pull request #391 from platformatic/feature/updating-components
Browse files Browse the repository at this point in the history
Feature/updating components
  • Loading branch information
tonysnowboardunderthebridge authored Nov 19, 2024
2 parents 391a22f + 0de25d2 commit a43c703
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/Checkbox.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.checkbox {
@apply border border-solid rounded-sm relative inline-block m-0;
@apply border border-solid rounded-sm relative inline-block m-0 hover:cursor-pointer;
-webkit-appearance: none;
}

Expand Down
12 changes: 9 additions & 3 deletions src/components/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ function Modal ({
childrenClassContainer = '',
modalCloseClassName = '',
permanent = false,
showCloseButtonOnTop = true
showCloseButtonOnTop = true,
additionalModalClassName = ''
}) {
let contentFullscreen
let titleFullscreen
let modalClassName = `${styles.modal}`
let modalClassName = `${styles.modal} `
modalClassName += ' ' + styles[`modal--${layout}`]
modalClassName += ' ' + styles[`modal--${size}`]
modalClassName += ` ${additionalModalClassName || styles.modalDefaultFlex}`
let buttonFullRoundedClassName
const blurRef = useRef()

Expand Down Expand Up @@ -309,7 +311,11 @@ Modal.propTypes = {
/**
* showCloseButtonOnTop: show button on X
*/
showCloseButtonOnTop: PropTypes.bool
showCloseButtonOnTop: PropTypes.bool,
/**
* additionalModalClassName: show button on X
*/
additionalModalClassName: PropTypes.string
}

export default Modal
6 changes: 5 additions & 1 deletion src/components/Modal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
.modal {
@apply p-4 rounded-md mx-auto my-auto max-h-[85vh] overflow-y-auto;
}
.modalDefaultFlex {
@apply flex flex-col gap-y-2;
}
.modal--popup-v2 {
@apply bg-rich-black border border-solid border-white/30 flex flex-col gap-y-4;
@apply bg-rich-black border border-solid;
border-color: rgba(255, 255, 255, .3);
}
.modal--popup {
@apply bg-light-blue;
Expand Down
28 changes: 25 additions & 3 deletions src/components/forms/InputFileUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styles from './InputFileUpload.module.css'
import commonStyles from '../Common.module.css'
import PlatformaticIcon from '../PlatformaticIcon'
import Button from '../Button'
import { ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, RICH_BLACK, TRANSPARENT, WHITE } from '../constants'
import { ACTIVE_AND_INACTIVE_STATUS, ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, RICH_BLACK, TRANSPARENT, WHITE } from '../constants'

function InputFileUpload ({
idInputFile = 'fileUpload',
Expand All @@ -19,12 +19,13 @@ function InputFileUpload ({
afterIcon = null,
backgroundColor = WHITE,
inputTextClassName = '',
detailTextClassName = '',
verticalPaddingClassName = '',
dataAttrName = '',
dataAttrValue = '',
readOnly = false,
removeFileButton = {},
showDetailButton = true,
detailFileButton = {},
onClickDetail = () => {},
acceptFiles = '*'
}) {
Expand Down Expand Up @@ -108,7 +109,20 @@ function InputFileUpload ({
>
{file !== null ? file.name : <span className={styles.inputPlaceholderClassName}>{inputPlaceholder}</span>}
</label>
{file !== null && <span className={`${styles.afterInputDetail} ${detailTextClassName}`} onClick={() => onClickDetail()}>Detail</span>}
{file !== null && showDetailButton && (
<div className={styles.afterInputDetail}>
<Button
textClass={detailFileButton?.textClass ?? ''}
paddingClass={detailFileButton?.paddingClass ?? ''}
label={detailFileButton?.label ?? 'Details'}
color={detailFileButton?.color ?? WHITE}
type='button'
onClick={() => onClickDetail()}
bordered={false}
hoverEffect={ACTIVE_AND_INACTIVE_STATUS}
/>
</div>
)}
</div>
{file !== null && (
<Button
Expand Down Expand Up @@ -211,6 +225,14 @@ InputFileUpload.propTypes = {
* removeFileButton
*/
removeFileButton: PropTypes.object,
/**
* showDetailButton
*/
showDetailButton: PropTypes.bool,
/**
* detailFileButton
*/
detailFileButton: PropTypes.object,
/**
* onClickDetail
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ToggleSwitch.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.container {
@apply flex w-full h-10 items-center gap-x-2;
@apply flex w-full items-center gap-x-2;
}
.switch {
@apply relative inline-block cursor-pointer;
Expand Down

0 comments on commit a43c703

Please sign in to comment.