Skip to content

Commit ce7702c

Browse files
authored
refactor(flat-pages): update styles (#2129)
- hide outline of copy invite code button - show join early minutes by server config when room not begin
1 parent b1b4a5c commit ce7702c

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

packages/flat-components/src/components/HomePage/RoomList/RoomListItem/style.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
padding: 4px 8px;
8888
border: 0;
8989
border-radius: 4px;
90+
outline: none;
9091
background-color: transparent;
9192
transition: background-color 0.2s;
9293
cursor: pointer;

packages/flat-i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@
655655
"minutes": "{{minutes}} minutes",
656656
"room-not-begin-title-post": "before it starts",
657657
"room-has-been-added": "has been added to rooms list",
658-
"the-room-is-not-started-yet": "Room not started, accessible 5 minutes before class starts",
658+
"the-room-is-not-started-yet": "Room not started, accessible {{minutes}} minutes before class starts",
659659
"will-start-after-minutes": "In {{minutes}} minutes",
660660
"time-limit-tip": "This {{roomType}} room has a limit of {{minutes}} minutes",
661661
"vip-level": {

packages/flat-i18n/locales/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@
655655
"minutes": "{{minutes}}分钟",
656656
"room-not-begin-title-post": "可进入",
657657
"room-has-been-added": "已加入房间列表",
658-
"the-room-is-not-started-yet": "房间未开始,开课前 5 分钟可进入",
658+
"the-room-is-not-started-yet": "房间未开始,开课前 {{minutes}} 分钟可进入",
659659
"will-start-after-minutes": "{{minutes}} 分钟后开始",
660660
"time-limit-tip": "你已加入{{roomType}} {{minutes}} 分钟限时房间",
661661
"vip-level": {

packages/flat-pages/src/utils/join-room-handler.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ export const joinRoomHandler = async (
7272
return;
7373
}
7474

75+
// show room not started with custom {joinEarly} minutes
76+
if (e.errorCode === RequestErrorCode.RoomNotBegin) {
77+
const minutes = globalStore.serverRegionConfig?.server.joinEarly || 5;
78+
void message.info(FlatI18n.t("the-room-is-not-started-yet", { minutes }));
79+
pushHistory(RouteNameType.HomePage);
80+
return;
81+
}
82+
7583
pushHistory(RouteNameType.HomePage);
7684
errorTips(e);
7785
}

0 commit comments

Comments
 (0)