diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json
index 66460f46db..047594ea2e 100644
--- a/src/assets/locales/en.json
+++ b/src/assets/locales/en.json
@@ -441,7 +441,7 @@
"leave-room-dialog.join-room.message": "Joining a new room will leave this one. Are you sure?",
"leave-room-dialog.join-room.confirm": "Join Room",
"leave-room-dialog.create-room.message": "Creating a new room will leave this one. Are you sure?",
- "leave-room-dialog.create-room.confirm": "Leave Room",
+ "leave-room-dialog.create-room.confirm": "Leave and Create Room",
"embed.load-button": "Load Room",
"embed.presence-warning": "This room is embedded, so may be visible to visitors on other websites.",
"tweet-dialog.tweet": "Tweet",
diff --git a/src/assets/locales/jp.json b/src/assets/locales/jp.json
index e0bfaa3be4..f4dbae5c6b 100644
--- a/src/assets/locales/jp.json
+++ b/src/assets/locales/jp.json
@@ -438,7 +438,7 @@
"leave-room-dialog.join-room.message": "新しい部屋に参加すると,この部屋から退室します。よろしいですか?",
"leave-room-dialog.join-room.confirm": "Join Room",
"leave-room-dialog.create-room.message": "新しい部屋を作成し、この部屋が残ります。よろしいですか?",
- "leave-room-dialog.create-room.confirm": "Leave Room",
+ "leave-room-dialog.create-room.confirm": "Leave and Create Room",
"embed.load-button": "ロードルーム",
"embed.presence-warning": "この部屋は埋め込まれているため,他のWebサイトの訪問者に表示される可能性があります。",
"tweet-dialog.tweet": "Tweet",
diff --git a/src/assets/stylesheets/leave-room-dialog.scss b/src/assets/stylesheets/leave-room-dialog.scss
deleted file mode 100644
index 12bbef8f22..0000000000
--- a/src/assets/stylesheets/leave-room-dialog.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-@import 'shared';
-
-:local(.leave-room) {
- display: flex;
- flex-direction: column;
- align-items: center;
-
- a {
- @extend %action-button;
- margin-top: 24px;
- }
-}
-
-
diff --git a/src/react-components/leave-room-dialog.js b/src/react-components/leave-room-dialog.js
deleted file mode 100644
index 41e6555517..0000000000
--- a/src/react-components/leave-room-dialog.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import React, { Component } from "react";
-import DialogContainer from "./dialog-container.js";
-import styles from "../assets/stylesheets/leave-room-dialog.scss";
-import { FormattedMessage } from "react-intl";
-import PropTypes from "prop-types";
-
-export default class LeaveRoomDialog extends Component {
- static propTypes = {
- messageType: PropTypes.string,
- destinationUrl: PropTypes.string
- };
-
- render() {
- return (
-
{intl.formatMessage(reasonMessages[reason])}
+ + + ); +} + +LeaveRoomModal.propTypes = { + reason: PropTypes.string, + destinationUrl: PropTypes.string, + onClose: PropTypes.func +}; diff --git a/src/react-components/room/LeaveRoomModal.scss b/src/react-components/room/LeaveRoomModal.scss new file mode 100644 index 0000000000..3d3a21c146 --- /dev/null +++ b/src/react-components/room/LeaveRoomModal.scss @@ -0,0 +1,17 @@ +:local(.leave-room-modal) { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + padding: 20px; + line-height: 1.25; + + & > * { + margin-bottom: 16px; + + &:last-child { + margin-bottom: 0; + } + } +} diff --git a/src/react-components/room/LeaveRoomModal.stories.js b/src/react-components/room/LeaveRoomModal.stories.js new file mode 100644 index 0000000000..7a5fc46220 --- /dev/null +++ b/src/react-components/room/LeaveRoomModal.stories.js @@ -0,0 +1,17 @@ +import React from "react"; +import { RoomLayout } from "../layout/RoomLayout"; +import { LeaveReason, LeaveRoomModal } from "./LeaveRoomModal"; + +export default { + title: "LeaveRoomModal", + parameters: { + layout: "fullscreen" + }, + args: { + destinationUrl: "#" + } +}; + +export const LeaveRoom = args =>