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

chore: remove unused and update icon names #387

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"scripts": {
"install:deps": "git submodule update --init --recursive && yarn install",
"dev": "vite",
"build:types": "rm -rf dist; rm -rf icons; rm -rf icons; tsc; cp -R src/icons icons; cp -R src/icons dist/icons ; cp -R src/css css; cp -R src/css dist/css",
"prebuild": "rm -rf ./dist && mv .env .env_temp || true",
"postbuild": "mv .env_temp .env || true",
"build": "yarn prebuild && tsc-silent -p './tsconfig.json' --suppress @ && vite build && yarn postbuild",
Expand Down Expand Up @@ -64,7 +63,7 @@
"ts-pattern": "^5.1.1",
"tsc-silent": "^1.2.2",
"typescript": "5.0.2",
"vite": "5.2.10",
"vite": "5.2.14",
"vite-plugin-dts": "^3.7.0",
"vite-plugin-svgr": "^4.2.0",
"vitest": "^1.6.0"
Expand Down
4 changes: 2 additions & 2 deletions src/components/BotProfileImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useChatContext } from './chat/context/ChatProvider';
import { getColorBasedOnSaturation } from '../colors';
import { useConstantState } from '../context/ConstantContext';
import { themedColors } from '../foundation/colors/css';
import BotProfileIcon from '../icons/bot-profile-image-small.svg';
import BotFilledIcon from '../icons/ic-bot-filled.svg';

function isMaybeFavicon(url: string) {
if (url.length < 4) return false;
Expand Down Expand Up @@ -44,7 +44,7 @@ const IconContainer = styled.span<{ backgroundColor: string; size: number }>`
align-items: center;
}`;

const Icon = styled(BotProfileIcon)<{ fill: string }>`
const Icon = styled(BotFilledIcon)<{ fill: string }>`
path {
fill: ${({ fill }) => fill};
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ErrorContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

import { Label } from '../foundation/components/Label';
import Icon from '../icons/icon-error.svg';
import ErrorIcon from '../icons/ic-error.svg';

const Container = styled.div`
width: 100%;
Expand All @@ -14,7 +14,7 @@ const Container = styled.div`
background-color: ${({ theme }) => theme.bgColor.loadingScreen};
`;

const ErrorIcon = styled(Icon)`
const Error = styled(ErrorIcon)`
path {
fill: ${({ theme }) => theme.textColor.errorMessage};
}
Expand All @@ -29,7 +29,7 @@ const ErrorMessage = styled(Label)`
export default function ErrorContainer({ errorMessage }: { errorMessage: string }) {
return (
<Container>
<ErrorIcon />
<Error />
<ErrorMessage className="sendbird-input-label" type={'body1'} color={'onbackground2'}>
{errorMessage || 'Something went wrong'}
</ErrorMessage>
Expand Down
4 changes: 2 additions & 2 deletions src/components/LoadingScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled, { keyframes } from 'styled-components';

import SpinIcon from '../icons/spin-icon.svg';
import SpinnerIcon from '../icons/ic-spinner.svg';

const spinner = keyframes`
0% {
Expand Down Expand Up @@ -39,7 +39,7 @@ export default function LoadingScreen() {
return (
<Container>
<IconContainer>
<SpinIcon width="50px" height="50px" />
<SpinnerIcon width="50px" height="50px" />
</IconContainer>
</Container>
);
Expand Down
26 changes: 13 additions & 13 deletions src/components/MessageDataContent.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import styled from 'styled-components';

import { useConstantState } from '../context/ConstantContext';
import ChevronRightIcon from '../icons/chevron-right.svg';
import EllipsisIcon from '../icons/icon-ellipsis.svg';
import MessageBubbleIcon from '../icons/icon-message-bubble.svg';
import ChevronRightIcon from '../icons/ic-chevron-right.svg';
import EllipsisIcon from '../icons/ic-ellipsis.svg';
import MessageIcon from '../icons/ic-message.svg';
import { FunctionCallData } from '../types';
import { noop } from '../utils';

Expand Down Expand Up @@ -121,7 +121,7 @@ const AdditionalInfo = styled.div`
margin-top: 5px;
`;

const Icon = styled.div`
const IconContainer = styled.div`
display: flex;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -239,9 +239,9 @@ export default function MessageDataContent({ messageData }: MessageDataContentPr
<DataContainer>
{workflow && (
<DataRow>
<Icon>
<MessageBubbleIcon id="aichatbot-widget-ellipsis-icon" />
</Icon>
<IconContainer>
<MessageIcon />
</IconContainer>
<Text>{workflow.name}</Text>
<LineHeightWrapper>
<WorkFlowType>{workflow.type}</WorkFlowType>
Expand All @@ -250,17 +250,17 @@ export default function MessageDataContent({ messageData }: MessageDataContentPr
)}
{functionCalls.map((renderData, index) => (
<DataRow key={index}>
<Icon>
<EllipsisIcon id="aichatbot-widget-message-bubble-icon" />
</Icon>
<IconContainer>
<EllipsisIcon />
</IconContainer>
<Text>{renderData.name}</Text>
<ViewDetails onClick={renderData.onClick}>
<TextButton>View details</TextButton>
<ChevronRightIcon id="aichatbot-widget-chevron-right-icon" />
<TextButton>{'View details'}</TextButton>
<ChevronRightIcon />
</ViewDetails>
</DataRow>
))}
<AdditionalInfo>Only visible in the dashboard widget</AdditionalInfo>
<AdditionalInfo>{'Only visible in the dashboard widget'}</AdditionalInfo>
</DataContainer>
</Root>
);
Expand Down
12 changes: 6 additions & 6 deletions src/components/SourceContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

import OpenLinkIcon from '../icons/open-link-icon.svg';
import OpenIcon from '../icons/ic-open.svg';

const Root = styled.div`
display: flex;
Expand Down Expand Up @@ -37,7 +37,7 @@ const SourceItem = styled.div`
gap: 16px;
`;

const IconLink = styled.a`
const IconContainer = styled.a`
display: flex;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -72,13 +72,13 @@ export default function SourceContainer(props: Props) {
<RootTitle>Source</RootTitle>
<SourceItem>
<div>
<SourceTitle href={source.source} id="openLinkText" target="_blank">
<SourceTitle href={source.source} target="_blank">
{source.title}
</SourceTitle>
</div>
<IconLink href={source.source} id="openLinkIcon" target="_blank" aria-label="Source link">
<OpenLinkIcon width={'15px'} height={'15px'} />
</IconLink>
<IconContainer href={source.source} target="_blank" aria-label="Source link">
<OpenIcon width={'15px'} height={'15px'} />
</IconContainer>
</SourceItem>
</Root>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/chat/ui/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useWidgetState } from '../../../context/WidgetStateContext';
import { themedColors } from '../../../foundation/colors/css';
import { Label } from '../../../foundation/components/Label';
import CloseIcon from '../../../icons/ic-close.svg';
import CollapseIcon from '../../../icons/ic-collapse.svg';
import ExpandIcon from '../../../icons/ic-expand.svg';
import CollapsedIcon from '../../../icons/icon-collapse.svg';
import BotProfileImage from '../../BotProfileImage';
import BetaLogo from '../../ui/BetaLogo';
import { useChatContext } from '../context/ChatProvider';
Expand Down Expand Up @@ -87,7 +87,7 @@ const RefreshButton = ({ size, onClick }: ButtonProps) => {

const ExpandButton = ({ size }: ButtonProps) => {
const { isExpanded, setIsExpanded } = useWidgetState();
const Icon = isExpanded ? CollapsedIcon : ExpandIcon;
const Icon = isExpanded ? CollapseIcon : ExpandIcon;

return (
<IconButton id={elementIds.expandIcon} aria-label={'expand'} onClick={() => setIsExpanded(!isExpanded)}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/messages/CarouselMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ReactNode } from 'react';
import styled, { useTheme } from 'styled-components';

import { useConstantState } from '../../context/ConstantContext';
import ChevronLeft from '../../icons/chevron-left.svg';
import ChevronRight from '../../icons/chevron-right.svg';
import ChevronLeft from '../../icons/ic-chevron-left.svg';
import ChevronRight from '../../icons/ic-chevron-right.svg';
import { WidgetCarouselItem } from '../../types';
import { openURL } from '../../utils';
import { SnapCarousel } from '../ui/SnapCarousel';
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/WidgetButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import styled, { css } from 'styled-components';

import { getColorBasedOnSaturation } from '../../colors';
import { elementIds } from '../../const';
import BotOutlinedIcon from '../../icons/bot-outlined.svg';
import ChevronDownIcon from '../../icons/chevron-down.svg';
import BotOutlinedIcon from '../../icons/ic-bot-outlined.svg';
import ChevronDownIcon from '../../icons/ic-chevron-down.svg';

const buttonEffect = css`
&:hover {
Expand Down
81 changes: 0 additions & 81 deletions src/dummy.ts

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
3 changes: 0 additions & 3 deletions src/icons/ic-sendbird-colored.svg

This file was deleted.

File renamed without changes
9 changes: 0 additions & 9 deletions src/icons/icon-send.svg

This file was deleted.

5 changes: 0 additions & 5 deletions src/icons/info-icon.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/icons/sendbird-logo-widget.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/// <reference types="vite/client" />
declare const APP_VERSION: string;
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3294,7 +3294,7 @@ __metadata:
ts-pattern: "npm:^5.1.1"
tsc-silent: "npm:^1.2.2"
typescript: "npm:5.0.2"
vite: "npm:5.2.10"
vite: "npm:5.2.14"
vite-plugin-dts: "npm:^3.7.0"
vite-plugin-svgr: "npm:^4.2.0"
vitest: "npm:^1.6.0"
Expand Down Expand Up @@ -18161,9 +18161,9 @@ __metadata:
languageName: node
linkType: hard

"vite@npm:5.2.10":
version: 5.2.10
resolution: "vite@npm:5.2.10"
"vite@npm:5.2.14":
version: 5.2.14
resolution: "vite@npm:5.2.14"
dependencies:
esbuild: "npm:^0.20.1"
fsevents: "npm:~2.3.3"
Expand Down Expand Up @@ -18197,7 +18197,7 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
checksum: 10c0/d50630ac8de807a6185cd9b5763b3969b2950a454cf6a4482f3780f183865e8d6f7e3aa57dd70ede1c493aaa861efb25b43562287efbcf8b471b7f3b88857a33
checksum: 10c0/0ed7a8f8274d14bbd01be2ca5c7c539f915e75d884a97f6051cdf494997832bc02c7db9fc9c5ba8f057d5fece28a3bf215761815e6014e843abe2c38a9424fb7
languageName: node
linkType: hard

Expand Down