Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bottom sheet prebuilt #1579

Merged
merged 28 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2ba763f
fix: initial update
amar-1995 Aug 4, 2023
aa28429
fix: index.js file added
amar-1995 Aug 4, 2023
a73e83e
Merge branch 'main' into WEB-1742-bottom-sheet-prebuild
amar-1995 Aug 4, 2023
11f7031
fix: added sheet stories
amar-1995 Aug 4, 2023
250f667
fix: added padding
amar-1995 Aug 4, 2023
804cafe
Merge branch 'main' into WEB-1742-bottom-sheet-prebuild
amar-1995 Aug 4, 2023
7d7034d
fix: added sheet to setting mobile view
amar-1995 Aug 6, 2023
841d764
fix: added sheet stories
amar-1995 Aug 6, 2023
c3f5e0e
fix: sheet position
KaustubhKumar05 Aug 7, 2023
461b89e
fix: design related fix
amar-1995 Aug 7, 2023
4bcf4ed
fix: opacity
KaustubhKumar05 Aug 7, 2023
9240978
Merge branch 'WEB-1742-bottom-sheet-prebuild' of https://github.com/1…
KaustubhKumar05 Aug 7, 2023
3610658
fix: added some design in modal
amar-1995 Aug 7, 2023
d348f9f
feat: completed setting modal preview
amar-1995 Aug 8, 2023
67846a5
fix: removed bottomsheet
amar-1995 Aug 8, 2023
ee8b882
fix: separate animation in utils
amar-1995 Aug 9, 2023
a736063
Merge branch 'main' into WEB-1742-bottom-sheet-prebuild
amar-1995 Aug 9, 2023
2198bdb
fix: prebuilt footer update
KaustubhKumar05 Aug 9, 2023
f0d90c3
fix: resolve conflict
KaustubhKumar05 Aug 10, 2023
462e983
fix: bottom sheet leave flow
KaustubhKumar05 Aug 10, 2023
6d5fdd8
fix: resolve conflicts
KaustubhKumar05 Aug 10, 2023
504204c
fix: use custom hook
KaustubhKumar05 Aug 10, 2023
14d26b9
feat: move options to bottom sheet
KaustubhKumar05 Aug 11, 2023
3df4f81
feat: flying emojis in bottom sheet
KaustubhKumar05 Aug 11, 2023
0863c43
feat: header for desktop and mweb
amar-1995 Aug 11, 2023
0dcac5e
Merge branch 'main' into WEB-1742-bottom-sheet-prebuild
amar-1995 Aug 11, 2023
adc556d
feat: recording start/stop mweb
amar-1995 Aug 11, 2023
f32a002
feat: tile menu in bottom sheet
KaustubhKumar05 Aug 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/100ms-web/src/components/Header/ParticipantList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ export const ParticipantSearch = ({ onSearch, placeholder }) => {
</Box>
<Input
type="text"
placeholder={placeholder || "Find what you are looking for"}
css={{ w: "100%", pl: "$14" }}
placeholder={placeholder || "Search among participants"}
css={{ w: "100%", pl: "$14", bg: "$surface_bright" }}
value={value}
onKeyDown={event => {
event.stopPropagation();
Expand Down
4 changes: 2 additions & 2 deletions packages/roomkit-react/src/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const DropdownItem = styled(Item, {
display: 'flex',
alignItems: 'center',
outline: 'none',
backgroundColor: '$surface_default',
backgroundColor: '$surface_dim',
'&:hover': {
cursor: 'pointer',
bg: '$surface_bright',
Expand All @@ -74,7 +74,7 @@ const DropdownContent = styled(Content, {
maxHeight: '$64',
r: '$1',
py: '$4',
backgroundColor: '$surface_default',
backgroundColor: '$surface_dim',
overflowY: 'auto',
boxShadow: '0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)',
zIndex: 20,
Expand Down
3 changes: 2 additions & 1 deletion packages/roomkit-react/src/Popover/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Arrow, Content, Popover as Root, Portal, Trigger } from '@radix-ui/react-popover';
import { Arrow, Close, Content, Popover as Root, Portal, Trigger } from '@radix-ui/react-popover';
import { styled } from '../Theme';
import { popoverAnimation } from '../utils/animations';

Expand All @@ -23,4 +23,5 @@ export const Popover = {
Trigger: StyledTrigger,
Portal: Portal,
Arrow: StyledArrow,
Close: Close,
};
4 changes: 2 additions & 2 deletions packages/roomkit-react/src/Prebuilt/Prebuilt.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
title: 'UI Components/Prebuilt',
component: HMSPrebuilt,
argTypes: {
roomCode: { control: { type: 'text' }, defaultValue: 'tsj-obqh-lwx' },
roomCode: { control: { type: 'text' }, defaultValue: 'cuf-wywo-trf' },
logo: { control: { type: 'object' }, defaultValue: undefined },
typography: { control: { type: 'object' }, defaultValue: 'Roboto' },
},
Expand All @@ -18,7 +18,7 @@ const PrebuiltRoomCodeStory: StoryFn<typeof HMSPrebuilt> = ({ roomCode = '', log

export const Example = PrebuiltRoomCodeStory.bind({});
Example.args = {
roomCode: 'tsj-obqh-lwx',
roomCode: 'cuf-wywo-trf',
options: {
endpoints: {
roomLayout: 'https://demo8271564.mockable.io/v2/layouts/ui',
Expand Down
8 changes: 8 additions & 0 deletions packages/roomkit-react/src/Prebuilt/common/hooks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// @ts-check
import { useEffect, useRef, useState } from 'react';
import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';
import { selectAvailableRoleNames, selectIsConnectedToRoom, selectPeerCount, useHMSStore } from '@100mslive/react-sdk';
import { useRoomLayout } from '../provider/roomLayoutProvider';
import { isInternalRole } from './utils';

/**
Expand Down Expand Up @@ -45,3 +47,9 @@ export const useFilteredRoles = () => {
const roles = useHMSStore(selectAvailableRoleNames).filter(role => !isInternalRole(role));
return roles;
};

export const useShowStreamingUI = () => {
const layout = useRoomLayout();
const { join_form } = layout?.screens?.preview?.default?.elements || {};
return join_form?.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE;
};
6 changes: 6 additions & 0 deletions packages/roomkit-react/src/Prebuilt/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,9 @@ export const getUpdatedHeight = (e, MINIMUM_HEIGHT) => {
const sheetHeightInVH = Math.max(MINIMUM_HEIGHT, heightToPercentage > 80 ? 100 : heightToPercentage);
return `${sheetHeightInVH}vh`;
};

export const getFormattedCount = num => {
const formatter = new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 2 });
const formattedNum = formatter.format(num);
return formattedNum;
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { isMacOS } from '../common/constants';

const optionsCSS = { fontWeight: '$semiBold', color: '$on_surface_high', w: '100%', p: '$8' };

export const AudioVideoToggle = () => {
export const AudioVideoToggle = ({ hideOptions = false }) => {
const { allDevices, selectedDeviceIDs, updateDevice } = useDevices();
const { videoInput, audioInput } = allDevices;

Expand Down Expand Up @@ -77,6 +77,7 @@ export const AudioVideoToggle = () => {
active={isLocalAudioEnabled}
onClick={toggleAudio}
key="toggleAudio"
hideOptions={hideOptions}
/>
) : null}

Expand All @@ -94,6 +95,7 @@ export const AudioVideoToggle = () => {
key="toggleVideo"
active={isLocalVideoEnabled}
onClick={toggleVideo}
hideOptions={hideOptions}
/>
) : null}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@100mslive/react-sdk';
import { CheckIcon } from '@100mslive/react-icons';
import { Box, Dropdown, Flex, HorizontalDivider, Text, Tooltip } from '../../../';
import { ParticipantSearch } from '../Header/ParticipantList';
import { ParticipantSearch } from '../Footer/ParticipantList';
import { useFilteredRoles } from '../../common/hooks';

const ChatDotIcon = () => {
Expand Down
31 changes: 1 addition & 30 deletions packages/roomkit-react/src/Prebuilt/components/EmojiReaction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import {
import { EmojiIcon } from '@100mslive/react-icons';
import { Dropdown } from '../../Dropdown';
import { Flex } from '../../Layout';
import { Text } from '../../Text';
import { styled } from '../../Theme';
import { Tooltip } from '../../Tooltip';
import IconButton from '../IconButton';
import { useHLSViewerRole } from './AppData/useUISettings';
import { useDropdownList } from './hooks/useDropdownList';
import { useIsFeatureEnabled } from './hooks/useFeatures';
import { EMOJI_REACTION_TYPE, FEATURE_LIST, HLS_TIMED_METADATA_DOC_URL } from '../common/constants';
import { EMOJI_REACTION_TYPE, FEATURE_LIST } from '../common/constants';

init({ data });

Expand Down Expand Up @@ -93,34 +92,6 @@ export const EmojiReaction = () => {
))}
</Flex>
))}
<div style={{ textAlign: 'center' }}>
<Text
variant="sm"
inline={true}
css={{
color: '$on_primary_medium',
}}
>
Reactions will be timed for Live Streaming viewers.{' '}
</Text>
<Text
variant="sm"
inline={true}
css={{
color: '$primary_bright',
fontWeight: '$semiBold',
}}
>
<a
href={HLS_TIMED_METADATA_DOC_URL}
target="_blank"
rel="noopener noreferrer"
style={{ color: 'inherit', textDecoration: 'none' }}
>
Learn more.
</a>
</Text>
</div>
</Dropdown.Content>
</Dropdown.Root>
</Fragment>
Expand Down
5 changes: 3 additions & 2 deletions packages/roomkit-react/src/Prebuilt/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { ConferencingFooter } from './Footer/ConferencingFooter';
import { StreamingFooter } from './Footer/StreamingFooter';
import { isStreamingKit } from '../common/utils';
import { useShowStreamingUI } from '../common/hooks';

export const Footer = () => {
return isStreamingKit() ? <StreamingFooter /> : <ConferencingFooter />;
const showStreamingUI = useShowStreamingUI();
return showStreamingUI ? <StreamingFooter /> : <ConferencingFooter />;
};
Loading