From 9ccb295004394fe31f210ba69eea0afcc5b160b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 4 Nov 2021 16:37:16 +0100 Subject: [PATCH] Restyle actions modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../features/ui/components/actions_modal.js | 33 ++++++++++++++----- app/styles/components/modal.scss | 26 ++++++++++++--- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/app/soapbox/features/ui/components/actions_modal.js b/app/soapbox/features/ui/components/actions_modal.js index 4a103a28e..69a5dce05 100644 --- a/app/soapbox/features/ui/components/actions_modal.js +++ b/app/soapbox/features/ui/components/actions_modal.js @@ -2,19 +2,25 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { FormattedMessage, injectIntl } from 'react-intl'; +import spring from 'react-motion/lib/spring'; import StatusContent from '../../../components/status_content'; import Avatar from '../../../components/avatar'; import RelativeTimestamp from '../../../components/relative_timestamp'; import DisplayName from '../../../components/display_name'; -import IconButton from '../../../components/icon_button'; +import Icon from '../../../components/icon'; +import Button from '../../../components/button'; +import Motion from '../util/optional_motion'; import classNames from 'classnames'; -export default class ActionsModal extends ImmutablePureComponent { +export default @injectIntl +class ActionsModal extends ImmutablePureComponent { static propTypes = { status: ImmutablePropTypes.map, actions: PropTypes.array, onClick: PropTypes.func, + onClose: PropTypes.func.isRequired, }; renderAction = (action, i) => { @@ -34,7 +40,7 @@ export default class ActionsModal extends ImmutablePureComponent { className={classNames({ active })} data-method={isLogout ? 'delete' : null} > - {icon && } + {icon && }
{text}
{meta}
@@ -45,6 +51,8 @@ export default class ActionsModal extends ImmutablePureComponent { } render() { + const { onClose } = this.props; + const status = this.props.status && (
@@ -68,13 +76,20 @@ export default class ActionsModal extends ImmutablePureComponent { ); return ( -
- {status} + + {({ top }) => ( +
+ {status} -
    - {this.props.actions.map(this.renderAction)} -
-
+
    + {this.props.actions.map(this.renderAction)} + +
+
+ )} + ); } diff --git a/app/styles/components/modal.scss b/app/styles/components/modal.scss index ca1bb1698..1f371e775 100644 --- a/app/styles/components/modal.scss +++ b/app/styles/components/modal.scss @@ -339,7 +339,7 @@ width: 480px; max-width: 90vw; border-radius: 10px; - border: 1px solid var(--primary-text-color--faint); + border: 1px solid var(--background-color); color: var(--primary-text-color--faint); background: var(--foreground-color); @@ -543,8 +543,10 @@ } .actions-modal { - width: calc(100% - 72px); - margin: 35px; + max-height: calc(100% - 16px); + width: calc(100% - 16px); + max-width: 500px; + margin: auto 0 8px; .status { overflow-y: auto; @@ -565,7 +567,6 @@ li:not(:empty) { &:first-of-type { margin: 10px 0 0; } - &:last-of-type { margin: 0 0 10px; } a { display: flex; @@ -590,10 +591,25 @@ box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.5); } } - button:first-child { margin-right: 10px; } + + .svg-icon:first-child { margin-right: 10px; } } } } + + &__close-button { + width: calc(100% - 16px); + margin: 8px; + background: var(--accent-color); + font-size: 15px; + font-weight: 600; + + &:active, + &:focus, + &:hover { + background: var(--accent-color--bright); + } + } } .confirmation-modal__action-bar,