mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-01 23:58:58 -04:00
Sort components (#163)
* Move common components to the `common` directory * rename style directory * Move ForkAwesome to common * Move initializers and restructure application-loader.tsx
This commit is contained in:
parent
f2e273fc40
commit
c949b6950e
125 changed files with 104 additions and 103 deletions
20
src/components/common/icon-button/icon-button.scss
Normal file
20
src/components/common/icon-button/icon-button.scss
Normal file
|
@ -0,0 +1,20 @@
|
|||
.btn-icon {
|
||||
padding: 0.375rem 0.375rem;
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
|
||||
.icon-part {
|
||||
padding: 0.375rem 0.375rem;
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
|
||||
.social-icon {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.text-part {
|
||||
padding: 0.375rem 0.75rem;
|
||||
}
|
||||
}
|
||||
|
23
src/components/common/icon-button/icon-button.tsx
Normal file
23
src/components/common/icon-button/icon-button.tsx
Normal file
|
@ -0,0 +1,23 @@
|
|||
import React from 'react'
|
||||
import { Button, ButtonProps } from 'react-bootstrap'
|
||||
import { ForkAwesomeIcon, IconName } from '../fork-awesome/fork-awesome-icon'
|
||||
import './icon-button.scss'
|
||||
|
||||
export interface SocialButtonProps extends ButtonProps {
|
||||
icon: IconName
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
export const IconButton: React.FC<SocialButtonProps> = ({ icon, children, variant, onClick }) => {
|
||||
return (
|
||||
<Button variant={variant} className={'btn-icon p-0 d-inline-flex align-items-stretch'}
|
||||
onClick={() => onClick?.()}>
|
||||
<span className="icon-part d-flex align-items-center">
|
||||
<ForkAwesomeIcon icon={icon} className={'icon'}/>
|
||||
</span>
|
||||
<span className="text-part d-flex align-items-center">
|
||||
{children}
|
||||
</span>
|
||||
</Button>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue