forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
064a942
commit 33823b6
Showing
5 changed files
with
99 additions
and
107 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
29 changes: 29 additions & 0 deletions
29
resources/scripts/components/elements/dialog/DialogIcon.tsx
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,29 @@ | ||
import React from 'react'; | ||
import { CheckIcon, ExclamationIcon, InformationCircleIcon, ShieldExclamationIcon } from '@heroicons/react/outline'; | ||
import classNames from 'classnames'; | ||
|
||
interface Props { | ||
type: 'danger' | 'info' | 'success' | 'warning'; | ||
className?: string; | ||
} | ||
|
||
export default ({ type, className }: Props) => { | ||
const [ Component, styles ] = (function (): [ (props: React.ComponentProps<'svg'>) => JSX.Element, string ] { | ||
switch (type) { | ||
case 'danger': | ||
return [ ShieldExclamationIcon, 'bg-red-500 text-red-50' ]; | ||
case 'warning': | ||
return [ ExclamationIcon, 'bg-yellow-600 text-yellow-50' ]; | ||
case 'success': | ||
return [ CheckIcon, 'bg-green-600 text-green-50' ]; | ||
case 'info': | ||
return [ InformationCircleIcon, 'bg-primary-500 text-primary-50' ]; | ||
} | ||
})(); | ||
|
||
return ( | ||
<div className={classNames('flex items-center justify-center w-10 h-10 rounded-full', styles, className)}> | ||
<Component className={'w-6 h-6'}/> | ||
</div> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export { default as Dialog } from './Dialog'; | ||
export { default as styles } from './style.module.css'; |
20 changes: 0 additions & 20 deletions
20
resources/scripts/components/elements/dialog/style.module.css
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