Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
feat: sync webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Aug 10, 2023
2 parents 5ae10b7 + 9c138b1 commit 1f240ec
Show file tree
Hide file tree
Showing 102 changed files with 1,312 additions and 598 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"src"
],
"dependencies": {
"@100mslive/roomkit-react": "0.1.1",
"@100mslive/hls-player": "0.1.10",
"@100mslive/hms-virtual-background": "1.11.10",
"@100mslive/react-icons": "0.8.10",
"@100mslive/react-sdk": "0.8.10",
"@100mslive/hls-player": "0.1.11",
"@100mslive/hms-virtual-background": "1.11.11",
"@100mslive/react-icons": "0.8.11",
"@100mslive/react-sdk": "0.8.11",
"@100mslive/roomkit-react": "0.1.2",
"@emoji-mart/data": "^1.0.6",
"@emoji-mart/react": "^1.0.1",
"@tldraw/tldraw": "^1.18.4",
Expand Down
24 changes: 8 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { KeyboardHandler } from "./components/Input/KeyboardInputManager";
import { Notifications } from "./components/Notifications";
import PostLeave from "./components/PostLeave";
import { ToastContainer } from "./components/Toast/ToastContainer";
import { hmsActions, hmsNotifications, hmsStats, hmsStore } from "./hms.js";
import { palette } from "./theme.js";
import { Confetti } from "./plugins/confetti";
import { FlyingEmoji } from "./plugins/FlyingEmoji.jsx";
import { RemoteStopScreenshare } from "./plugins/RemoteStopScreenshare";
Expand Down Expand Up @@ -68,7 +68,6 @@ export function EdtechComponent({
logo = "",
headerPresent = "false",
metadata = "",
recordingUrl = "",
},
policyConfig = envPolicyConfig,
getDetails = () => {},
Expand All @@ -77,7 +76,6 @@ export function EdtechComponent({
const { 0: width, 1: height } = aspectRatio
.split("-")
.map(el => parseInt(el));

globalStyles();

return (
Expand All @@ -87,35 +85,29 @@ export function EdtechComponent({
aspectRatio={getAspectRatio({ width, height })}
theme={{
colors: {
brandDefault: color,
brandDark: shadeColor(color, -30),
brandLight: shadeColor(color, 30),
brandDisabled: shadeColor(color, 10),
...palette[theme],
primary_default: color,
primary_dark: shadeColor(color, -30),
primary_bright: shadeColor(color, 30),
primary_disabled: shadeColor(color, 10),
},
fonts: {
sans: [font, "Inter", "sans-serif"],
},
}}
>
<HMSRoomProvider
isHMSStatsOn={FeatureFlags.enableStatsForNerds}
actions={hmsActions}
store={hmsStore}
notifications={hmsNotifications}
stats={hmsStats}
>
<HMSRoomProvider isHMSStatsOn={FeatureFlags.enableStatsForNerds}>
<AppData
appDetails={metadata}
policyConfig={policyConfig}
recordingUrl={recordingUrl}
logo={logo}
tokenEndpoint={tokenEndpoint}
/>

<Init />
<Box
css={{
bg: "$mainBg",
bg: "$background_dim",
w: "100%",
lineHeight: "1.5",
"-webkit-text-size-adjust": "100%",
Expand Down
4 changes: 2 additions & 2 deletions src/IconButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { IconButton as BaseIconButton, styled } from "@100mslive/roomkit-react";
const IconButton = styled(BaseIconButton, {
width: "$14",
height: "$14",
border: "1px solid $borderLight",
border: "1px solid $border_bright",
r: "$1",
variants: {
active: {
false: {
border: "1px solid transparent",
color: "$white",
color: "$on_primary_high",
},
},
},
Expand Down
1 change: 0 additions & 1 deletion src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export const APP_DATA = {
chatSelector: "chatSelector",
chatDraft: "chatDraft",
appConfig: "appConfig",
recordingUrl: "recordingUrl",
sidePane: "sidePane",
hlsStats: "hlsStats",
hlsViewerRole: "hlsViewerRole",
Expand Down
9 changes: 1 addition & 8 deletions src/common/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QUERY_PARAM_SKIP_PREVIEW, QUESTION_TYPE } from "./constants";
import { QUESTION_TYPE } from "./constants";

export function shadeColor(color, percent) {
let R = parseInt(color.substring(1, 3), 16);
Expand Down Expand Up @@ -60,13 +60,6 @@ export const isScreenshareSupported = () => {
return typeof navigator.mediaDevices.getDisplayMedia !== "undefined";
};

export const getDefaultMeetingUrl = () => {
return (
window.location.href.replace("meeting", "preview") +
`?${QUERY_PARAM_SKIP_PREVIEW}=true`
);
};

export const getRoutePrefix = () => {
return window.location.pathname.startsWith("/streaming") ? "/streaming" : "";
};
Expand Down
5 changes: 2 additions & 3 deletions src/components/AppData/AppData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const initialAppData = {
};

export const AppData = React.memo(
({ appDetails, logo, recordingUrl, tokenEndpoint, policyConfig, uiMode }) => {
({ appDetails, logo, tokenEndpoint, policyConfig, uiMode }) => {
const hmsActions = useHMSActions();
const isConnected = useHMSStore(selectIsConnectedToRoom);
const sidePane = useSidepaneState();
Expand Down Expand Up @@ -128,7 +128,6 @@ export const AppData = React.memo(

useEffect(() => {
const appData = {
[APP_DATA.recordingUrl]: recordingUrl,
[APP_DATA.tokenEndpoint]: tokenEndpoint,
[APP_DATA.logo]: logo,
[APP_DATA.hlsViewerRole]:
Expand All @@ -140,7 +139,7 @@ export const AppData = React.memo(
for (const key in appData) {
hmsActions.setAppData([key], appData[key]);
}
}, [appDetails, logo, recordingUrl, tokenEndpoint, uiMode, hmsActions]);
}, [appDetails, logo, tokenEndpoint, uiMode, hmsActions]);

useEffect(() => {
if (!preferences.subscribedNotifications) {
Expand Down
9 changes: 7 additions & 2 deletions src/components/Chat/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ const PinnedMessage = ({ clearPinnedMessage }) => {

return pinnedMessage ? (
<Flex
css={{ p: "$8", color: "$textMedEmp", bg: "$surfaceLight", r: "$1" }}
css={{
p: "$8",
color: "$on_surface_medium",
bg: "$surface_bright",
r: "$1",
}}
align="center"
justify="between"
>
Expand All @@ -37,7 +42,7 @@ const PinnedMessage = ({ clearPinnedMessage }) => {
<Box
css={{
ml: "$8",
color: "$textMedEmp",
color: "$on_surface_medium",
w: "100%",
maxHeight: "$18",
overflowY: "auto",
Expand Down
18 changes: 11 additions & 7 deletions src/components/Chat/ChatBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,22 @@ const MessageTypeContainer = ({ left, right }) => {
ml: "auto",
mr: "$4",
p: "$2 $4",
border: "1px solid $textDisabled",
border: "1px solid $on_surface_low",
r: "$0",
}}
>
{left && (
<SenderName variant="tiny" as="span" css={{ color: "$textMedEmp" }}>
<SenderName
variant="tiny"
as="span"
css={{ color: "$on_surface_medium" }}
>
{left}
</SenderName>
)}
{left && right && (
<Box
css={{ borderLeft: "1px solid $textDisabled", mx: "$4", h: "$8" }}
css={{ borderLeft: "1px solid $on_surface_low", mx: "$4", h: "$8" }}
/>
)}
{right && (
Expand Down Expand Up @@ -108,7 +112,7 @@ const URL_REGEX =
/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;

const Link = styled("a", {
color: "$brandDefault",
color: "$primary_default",
wordBreak: "break-word",
"&:hover": {
textDecoration: "underline",
Expand Down Expand Up @@ -219,7 +223,7 @@ const ChatMessage = React.memo(
align="center"
css={{
flexWrap: "wrap",
bg: messageType ? "$surfaceLight" : undefined,
bg: messageType ? "$surface_bright" : undefined,
r: messageType ? "$1" : undefined,
px: messageType ? "$4" : "$2",
py: messageType ? "$4" : 0,
Expand All @@ -230,7 +234,7 @@ const ChatMessage = React.memo(
>
<Text
css={{
color: "$textHighEmp",
color: "$on_surface_high",
fontWeight: "$semiBold",
display: "inline-flex",
alignItems: "center",
Expand All @@ -254,7 +258,7 @@ const ChatMessage = React.memo(
variant="sm"
css={{
ml: "$4",
color: "$textSecondary",
color: "$on_surface_medium",
flexShrink: 0,
}}
>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Chat/ChatFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const TextArea = styled("textarea", {
width: "100%",
fontFamily: "$sans",
bg: "transparent",
color: "$textPrimary",
color: "$on_surface_high",
resize: "none",
lineHeight: "1rem",
position: "relative",
Expand Down Expand Up @@ -113,7 +113,7 @@ export const ChatFooter = ({ role, peerId, onSend, children }) => {
<Flex
align="center"
css={{
bg: "$surfaceLight",
bg: "$surface_bright",
minHeight: "$16",
maxHeight: "$24",
position: "relative",
Expand All @@ -127,6 +127,7 @@ export const ChatFooter = ({ role, peerId, onSend, children }) => {
placeholder="Write something here"
ref={inputRef}
autoFocus
css={{ fontSize: "1rem" }}
onKeyPress={async event => {
if (event.key === "Enter") {
if (!event.shiftKey) {
Expand Down
7 changes: 4 additions & 3 deletions src/components/Chat/ChatHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ChatHeader = React.memo(
onClick={onToggle}
align="center"
css={{
color: "$textPrimary",
color: "$on_surface_high",
h: "$16",
mb: "$2",
}}
Expand All @@ -36,7 +36,7 @@ export const ChatHeader = React.memo(
asChild
data-testid="participant_list_filter"
css={{
border: "1px solid $textDisabled",
border: "1px solid $on_surface_low",
r: "$0",
p: "$2 $4",
ml: "$8",
Expand All @@ -47,7 +47,7 @@ export const ChatHeader = React.memo(
<Text variant="sm" css={{ ...textEllipsis(80) }}>
{selection}
</Text>
<Box css={{ ml: "$2", color: "$textDisabled" }}>
<Box css={{ ml: "$2", color: "$on_surface_low" }}>
{open ? (
<ChevronUpIcon width={14} height={14} />
) : (
Expand All @@ -61,6 +61,7 @@ export const ChatHeader = React.memo(
w: "$64",
overflow: "hidden",
maxHeight: "unset",
backgroundColor: "$surface_default",
}}
align="start"
sideOffset={8}
Expand Down
10 changes: 7 additions & 3 deletions src/components/Chat/ChatSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@ import { useFilteredRoles } from "../../common/hooks";

const ChatDotIcon = () => {
return (
<Box css={{ size: "$6", bg: "$brandDefault", mx: "$2", r: "$round" }} />
<Box css={{ size: "$6", bg: "$primary_default", mx: "$2", r: "$round" }} />
);
};

const SelectorItem = ({ value, active, onClick, unreadCount }) => {
return (
<Dropdown.Item
data-testid="chat_members"
css={{ align: "center", px: "$10" }}
css={{
align: "center",
px: "$10",
"&:hover": { backgroundColor: "$surface_brighter" },
}}
onClick={onClick}
>
<Text variant="sm">{value}</Text>
<Flex align="center" css={{ ml: "auto", color: "$textPrimary" }}>
<Flex align="center" css={{ ml: "auto", color: "$on_surface_high" }}>
{unreadCount > 0 && (
<Tooltip title={`${unreadCount} unread`}>
<Box css={{ mr: active ? "$3" : 0 }}>
Expand Down
12 changes: 6 additions & 6 deletions src/components/Chat/useEmojiPickerStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ export const useEmojiPickerStyles = showing => {
const style = document.createElement("style");
style.textContent = `
#root {
--em-rgb-color: var(--hms-ui-colors-textPrimary);
--em-rgb-input: var(--hms-ui-colors-textPrimary);
--em-color-border: var(--hms-ui-colors-surfaceDefault);
--color-b: var(--hms-ui-colors-textPrimary);
--em-rgb-color: var(--hms-ui-colors-on_surface_high);
--em-rgb-input: var(--hms-ui-colors-on_surface_high);
--em-color-border: var(--hms-ui-colors-surface_default);
--color-b: var(--hms-ui-colors-on_surface_high);
--rgb-background: transparent;
color: var(--hms-ui-colors-textPrimary);
color: var(--hms-ui-colors-on_surface_high);
font-family: var(--hms-ui-fonts-sans);
}
.sticky {
background-color: var(--hms-ui-colors-surfaceLight);
background-color: var(--hms-ui-colors-surface_bright);
}
`;
root?.appendChild(style);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Connection/TileConnection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const TileConnection = ({ name, peerId, hideLabel, width }) => {
{!hideLabel ? (
<Text
css={{
c: "$textHighEmp",
c: "$on_surface_high",
...textEllipsis(width - 60),
}}
variant="xs"
Expand All @@ -28,7 +28,7 @@ const Wrapper = styled("div", {
position: "absolute",
bottom: "$2",
left: "$2",
backgroundColor: "$backgroundDark",
backgroundColor: "$background_dim",
borderRadius: "$1",
maxWidth: "85%",
zIndex: 1,
Expand Down
Loading

3 comments on commit 1f240ec

@vercel
Copy link

@vercel vercel bot commented on 1f240ec Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

100ms-web – ./

100ms-web-git-main-akash1234.vercel.app
100ms-web-akash1234.vercel.app
100ms-web-taupe.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 1f240ec Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 1f240ec Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.