Skip to content

Commit

Permalink
Fix: assets not showing after deployment
Browse files Browse the repository at this point in the history
- all window url to asset path
  • Loading branch information
babboe1 committed Aug 13, 2024
1 parent c00821b commit 813c3c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui-gallery",
"version": "0.1.20",
"version": "0.1.21",
"type": "module",
"files": [
"package-dist"
Expand Down
12 changes: 7 additions & 5 deletions src/components/AILoader.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { Flex, Image, Skeleton } from "antd";
import { Flex, Image, Skeleton } from 'antd';

export default function AILoader() {
const logoLink =
window?.location?.hostname === 'localhost' ? '/' : `${window.location}`;
return (
<Flex style={{ width: "90%" }} align="flex-start" gap={8}>
<Flex style={{ width: '90%' }} align="flex-start" gap={8}>
<Image
className="ai-icon-rotate"
src="/ai-icon.svg"
src={`${logoLink}/ai-icon.svg`}
height={40}
width={40}
style={{
height: "2rem",
width: "2rem",
height: '2rem',
width: '2rem',
}}
/>
<Skeleton active></Skeleton>
Expand Down
4 changes: 3 additions & 1 deletion src/components/AIMessageComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export function AIMessageComponents<T extends BaseMessage>({
regenerateResponse?: boolean,
) => void;
}) {
const logoLink =
window?.location?.hostname === 'localhost' ? '/' : `${window.location}`;
const content = messages[index]?.content;
const isLastMessage = messages?.length - 1 === index;
const shouldShowActionCardItems = isLastMessage && showMessageActionCard;
Expand Down Expand Up @@ -79,7 +81,7 @@ export function AIMessageComponents<T extends BaseMessage>({
className="ai-message-wrapper"
>
<Image
src="/ai-icon.svg"
src={`${logoLink}/ai-icon.svg`}
height={40}
width={40}
style={{
Expand Down
4 changes: 3 additions & 1 deletion src/components/AiMessageTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export default function AiMessageTable({
rowData,
columnDefs,
}: AiMessageTableProps) {
const logoLink =
window?.location?.hostname === 'localhost' ? '/' : `${window.location}`;
const [ellipsis] = useState(true);
const [showSqlModal, setShowSqlModal] = useState(false);
const [messageApi, contextHolder] = message.useMessage();
Expand All @@ -94,7 +96,7 @@ export default function AiMessageTable({
renderItem={(item) => (
<List.Item>
<List.Item.Meta
avatar={<Image preview={false} width={26} src={item.img} />}
avatar={<Image preview={false} width={26} src={`${logoLink}/${item.img}`} />}
title={<a href="https://ant.design">{item.text}</a>}
/>
</List.Item>
Expand Down

0 comments on commit 813c3c8

Please sign in to comment.