-
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
Showing
6 changed files
with
173 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import Icon from '@ant-design/icons'; | ||
|
||
const ArchiveSvg = () => ( | ||
<svg color="white" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="16"> | ||
<path d="M0 0h24v24H0z" fill="none" /> | ||
<path | ||
fill="white" | ||
d="M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z" | ||
/> | ||
</svg> | ||
); | ||
const ArchiveIcon = (props) => <Icon component={ArchiveSvg} {...props} />; | ||
|
||
export default ArchiveIcon; |
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,15 @@ | ||
import React from 'react'; | ||
import Icon from '@ant-design/icons'; | ||
|
||
const RestoreSvg = () => ( | ||
<svg color="white" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="16"> | ||
<path d="M0 0h24v24H0z" fill="none" /> | ||
<path | ||
fill="white" | ||
d="M19 13C16.83 13 14.93 14.16 13.88 15.89C13.28 15.96 12.65 16 12 16C7.58 16 4 14.21 4 12V9C4 11.21 7.58 13 12 13S20 11.21 20 9V12C20 12.36 19.9 12.71 19.72 13.05C19.5 13 19.24 13 19 13M12 11C16.42 11 20 9.21 20 7S16.42 3 12 3 4 4.79 4 7 7.58 11 12 11M13.1 17.96C12.74 18 12.37 18 12 18C7.58 18 4 16.21 4 14V17C4 19.21 7.58 21 12 21C12.46 21 12.9 21 13.33 20.94C13.12 20.33 13 19.68 13 19C13 18.64 13.04 18.3 13.1 17.96M19 15L16 18H18V22H20V18H22L19 15Z" | ||
/> | ||
</svg> | ||
); | ||
const RestoreIcon = (props) => <Icon component={RestoreSvg} {...props} />; | ||
|
||
export default RestoreIcon; |
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,41 @@ | ||
import { Button } from "antd"; | ||
import RestoreIcon from "../icons/RestoreIcon.js"; | ||
import ArchiveIcon from "../icons/ArchiveIcon.js"; | ||
|
||
/** | ||
* @param record | ||
* @param onRestore | ||
* @param onArchive | ||
* @param props | ||
* @constructor | ||
*/ | ||
export default function IsArchiveToggle({ isArchive, onRestore, onArchive, ...props }) { | ||
const IconComponent = ({ type, handler }) => { | ||
let icon = "Тут могла быть ваша реклама."; | ||
|
||
if (type === "restore") { | ||
icon = <RestoreIcon />; | ||
} | ||
|
||
if (type === "archive") { | ||
icon = <ArchiveIcon />; | ||
} | ||
|
||
return ( | ||
<Button | ||
className={`archive-button archive-${type}-button`} | ||
size="small" | ||
onClick={handler} | ||
type="primary" | ||
shape="circle" | ||
icon={icon} | ||
/> | ||
); | ||
}; | ||
|
||
return ( | ||
<span {...props}> | ||
<IconComponent type={isArchive ? "restore" : "archive"} handler={isArchive ? onRestore : onArchive} /> | ||
</span> | ||
); | ||
} |
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,46 @@ | ||
.archive-button { | ||
vertical-align: bottom; | ||
} | ||
|
||
.archive-archive-button:not(.outlined) { | ||
background: #ffba24 !important; | ||
border-color: #f4af17 !important; | ||
} | ||
|
||
.archive-archive-button:not(.outlined):hover { | ||
background: #f8d383 !important; | ||
border-color: #f8c148 !important; | ||
} | ||
|
||
.archive-archive-button.outlined { | ||
color: #e9b105; | ||
border-color: #e9b105 !important; | ||
} | ||
|
||
.archive-archive-button.outlined:hover, .archive-archive-button.outlined:focus { | ||
color: white; | ||
background: #e9b105 !important; | ||
border-color: #e9b105 !important; | ||
} | ||
|
||
.archive-restore-button { | ||
background: #2cb332 !important; | ||
border-color: #1baa21 !important; | ||
} | ||
|
||
.archive-restore-button:hover { | ||
background: #3bc641 !important; | ||
border-color: #3bc641 !important; | ||
} | ||
|
||
.archive-restore-button.outlined { | ||
color: #2cb332; | ||
border-color: #2cb332 !important; | ||
background: white !important; | ||
} | ||
|
||
.archive-restore-button.outlined:hover, .archive-restore-button.outlined:focus { | ||
color: white; | ||
background: #2cb332 !important; | ||
border-color: #2cb332 !important; | ||
} |