-
Notifications
You must be signed in to change notification settings - Fork 1
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
99 changed files
with
6,601 additions
and
105 deletions.
There are no files selected for viewing
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,133 @@ | ||
import './add.scss'; | ||
|
||
// import dependencies | ||
import PropTypes from 'prop-types'; | ||
import { MdHistory } from 'react-icons/md'; | ||
import { BsGraphUp } from 'react-icons/bs'; | ||
import { IoWarning } from 'react-icons/io5'; | ||
import { PiBroadcast } from 'react-icons/pi'; | ||
import { FaSignal, FaHtml5, FaCss3Alt } from 'react-icons/fa'; | ||
import { TbLayoutNavbarInactive } from 'react-icons/tb'; | ||
|
||
// import local files | ||
import Modal from '../../../ui/modal'; | ||
import classNames from 'classnames'; | ||
import { useState } from 'react'; | ||
|
||
const components = [ | ||
{ | ||
name: 'Header', | ||
icon: (size) => ( | ||
<TbLayoutNavbarInactive | ||
style={{ width: `${size}px`, height: `${size}px` }} | ||
/> | ||
), | ||
type: 'header', | ||
}, | ||
{ | ||
name: 'Status', | ||
icon: (size) => ( | ||
<PiBroadcast style={{ width: `${size}px`, height: `${size}px` }} /> | ||
), | ||
type: 'status', | ||
}, | ||
{ | ||
name: 'Incidents', | ||
icon: (size) => ( | ||
<IoWarning style={{ width: `${size}px`, height: `${size}px` }} /> | ||
), | ||
type: 'incidents', | ||
}, | ||
{ | ||
name: 'Uptime', | ||
icon: (size) => ( | ||
<FaSignal style={{ width: `${size}px`, height: `${size}px` }} /> | ||
), | ||
type: 'uptime', | ||
}, | ||
{ | ||
name: 'Metrics', | ||
icon: (size) => ( | ||
<BsGraphUp style={{ width: `${size}px`, height: `${size}px` }} /> | ||
), | ||
type: 'metrics', | ||
}, | ||
{ | ||
name: 'History', | ||
icon: (size) => ( | ||
<MdHistory style={{ width: `${size}px`, height: `${size}px` }} /> | ||
), | ||
type: 'history', | ||
}, | ||
{ | ||
name: 'Custom HTML', | ||
icon: (size) => ( | ||
<FaHtml5 style={{ width: `${size}px`, height: `${size}px` }} /> | ||
), | ||
type: 'customHTML', | ||
}, | ||
{ | ||
name: 'Custom CSS', | ||
icon: (size) => ( | ||
<FaCss3Alt style={{ width: `${size}px`, height: `${size}px` }} /> | ||
), | ||
type: 'customCSS', | ||
}, | ||
]; | ||
|
||
const StatusConfigureAddModal = ({ closeModal, createComponent }) => { | ||
const [activeComponent, setActiveComponent] = useState(null); | ||
|
||
return ( | ||
<Modal.Container closeButton={closeModal}> | ||
<Modal.Title style={{ textAlign: 'center', fontSize: 'var(--font-xl)' }}> | ||
Add New Component | ||
</Modal.Title> | ||
<Modal.Message> | ||
<div className="scma-container"> | ||
{components.map((component) => { | ||
const classes = classNames('scma-item', { | ||
active: component.type === activeComponent, | ||
}); | ||
|
||
return ( | ||
<div | ||
key={component.name} | ||
className={classes} | ||
onClick={() => { | ||
setActiveComponent(component.type); | ||
}} | ||
> | ||
<div className="scma-item-icon">{component.icon(28)}</div> | ||
<div className="scma-item-name">{component.name}</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</Modal.Message> | ||
|
||
<Modal.Actions> | ||
<Modal.Button onClick={closeModal}>Close</Modal.Button> | ||
<Modal.Button | ||
color="green" | ||
id="monitor-create-button" | ||
onClick={() => { | ||
createComponent(activeComponent); | ||
closeModal(); | ||
}} | ||
> | ||
Add | ||
</Modal.Button> | ||
</Modal.Actions> | ||
</Modal.Container> | ||
); | ||
}; | ||
|
||
StatusConfigureAddModal.displayName = 'StatusConfigureAddModal'; | ||
|
||
StatusConfigureAddModal.propTypes = { | ||
closeModal: PropTypes.func.isRequired, | ||
createComponent: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default StatusConfigureAddModal; |
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 @@ | ||
// status-configure-modal-add > scma | ||
|
||
.scma-container { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr; | ||
grid-gap: 10px; | ||
margin: 20px 0px 10px 0px; | ||
} | ||
|
||
.scma-item { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border: 2px solid var(--accent-700); | ||
padding: 10px; | ||
cursor: pointer; | ||
flex-direction: column; | ||
border-radius: 12px; | ||
transition: all 0.2s ease-in-out; | ||
|
||
&:hover { | ||
transition: all 0.2s ease-in-out; | ||
border-color: var(--primary-700); | ||
|
||
.scma-item-icon { | ||
transition: all 0.2s ease-in-out; | ||
color: var(--primary-700); | ||
} | ||
} | ||
|
||
&.active { | ||
border-color: var(--primary-700); | ||
|
||
.scma-item-icon { | ||
color: var(--primary-700); | ||
} | ||
} | ||
} | ||
|
||
.scma-item-name { | ||
font-size: var(--font-md); | ||
color: var(--font-color); | ||
} |
Oops, something went wrong.