Compare commits

...

1 Commits

Author SHA1 Message Date
Abhi Kumar
17dec71695 chore: updated styles for dashboard creation modal 2025-11-20 15:40:46 +05:30
4 changed files with 135 additions and 105 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View File

@@ -68,7 +68,7 @@
.template-list-item { .template-list-item {
display: flex; display: flex;
gap: 8px; gap: 8px;
padding: 4px 12px; padding: 8px 12px;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
height: 32px; height: 32px;
@@ -76,8 +76,10 @@
.template-icon { .template-icon {
display: flex; display: flex;
height: 14px; height: 20px;
width: 14px; width: 20px;
border-radius: 2px;
padding: 4px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
@@ -97,6 +99,17 @@
&.active { &.active {
border-radius: 3px; border-radius: 3px;
background: rgba(171, 189, 255, 0.08); background: rgba(171, 189, 255, 0.08);
position: relative;
&::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 2px;
background: var(--bg-robin-500);
}
} }
} }
} }
@@ -159,18 +172,38 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin: 24px; padding: 16px;
height: calc(100% - 144px); height: calc(100% - 144px);
position: relative; position: relative;
img { &-container {
position: relative;
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
padding: 24px; padding: 48px 24px;
border-radius: 4px;
border: 1px solid var(--bg-ink-50); border: 1px solid var(--bg-ink-50);
background: var(--bg-ink-300); background: linear-gradient(98.66deg, #7a97fa 4.42%, #f977ff 96.6%);
max-height: 100%; max-height: 100%;
&::before {
content: '';
position: absolute;
inset: 0;
background: url('/public/Images/grains.png');
background-size: contain;
background-repeat: repeat;
opacity: 0.1;
}
}
img {
position: relative;
width: 100%;
max-width: 100%;
max-height: 540px;
object-fit: contain; object-fit: contain;
border-radius: 4px;
} }
} }
} }

View File

@@ -4,6 +4,7 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */ /* eslint-disable @typescript-eslint/explicit-function-return-type */
import './DashboardTemplatesModal.styles.scss'; import './DashboardTemplatesModal.styles.scss';
import { Color } from '@signozhq/design-tokens';
import { Button, Input, Modal, Typography } from 'antd'; import { Button, Input, Modal, Typography } from 'antd';
import ApacheIcon from 'assets/CustomIcons/ApacheIcon'; import ApacheIcon from 'assets/CustomIcons/ApacheIcon';
import DockerIcon from 'assets/CustomIcons/DockerIcon'; import DockerIcon from 'assets/CustomIcons/DockerIcon';
@@ -16,7 +17,14 @@ import NginxIcon from 'assets/CustomIcons/NginxIcon';
import PostgreSQLIcon from 'assets/CustomIcons/PostgreSQLIcon'; import PostgreSQLIcon from 'assets/CustomIcons/PostgreSQLIcon';
import RedisIcon from 'assets/CustomIcons/RedisIcon'; import RedisIcon from 'assets/CustomIcons/RedisIcon';
import cx from 'classnames'; import cx from 'classnames';
import { ConciergeBell, DraftingCompass, Drill, Plus, X } from 'lucide-react'; import {
ConciergeBell,
DraftingCompass,
Drill,
Plus,
Search,
X,
} from 'lucide-react';
import { ChangeEvent, useState } from 'react'; import { ChangeEvent, useState } from 'react';
import { DashboardTemplate } from 'types/api/dashboard/getAll'; import { DashboardTemplate } from 'types/api/dashboard/getAll';
@@ -162,7 +170,9 @@ export default function DashboardTemplatesModal({
<div className="new-dashboard-templates-list"> <div className="new-dashboard-templates-list">
<Input <Input
className="new-dashboard-templates-search" className="new-dashboard-templates-search"
placeholder="🔍 Search..." placeholder="Search..."
size="middle"
prefix={<Search size={12} color={Color.TEXT_VANILLA_400} />}
onChange={handleDashboardTemplateSearch} onChange={handleDashboardTemplateSearch}
/> />
@@ -212,6 +222,7 @@ export default function DashboardTemplatesModal({
</div> </div>
<div className="template-preview-image"> <div className="template-preview-image">
<div className="template-preview-image-container">
<img <img
src={selectedDashboardTemplate.previewImage} src={selectedDashboardTemplate.previewImage}
alt={`${selectedDashboardTemplate.name}-preview`} alt={`${selectedDashboardTemplate.name}-preview`}
@@ -220,6 +231,7 @@ export default function DashboardTemplatesModal({
</div> </div>
</div> </div>
</div> </div>
</div>
</Modal> </Modal>
); );
} }

View File

@@ -7,10 +7,9 @@ import './DashboardList.styles.scss';
import { Color } from '@signozhq/design-tokens'; import { Color } from '@signozhq/design-tokens';
import { import {
Button, Button,
Dropdown,
Flex, Flex,
Input, Input,
MenuProps, // MenuProps,
Modal, Modal,
Popover, Popover,
Skeleton, Skeleton,
@@ -47,14 +46,14 @@ import {
Ellipsis, Ellipsis,
EllipsisVertical, EllipsisVertical,
Expand, Expand,
ExternalLink, // ExternalLink,
FileJson, FileJson,
Github, // Github,
HdmiPort, HdmiPort,
LayoutGrid, // LayoutGrid,
Link2, Link2,
Plus, Plus,
Radius, // Radius,
RotateCw, RotateCw,
Search, Search,
SquareArrowOutUpRight, SquareArrowOutUpRight,
@@ -71,7 +70,6 @@ import {
Key, Key,
useCallback, useCallback,
useEffect, useEffect,
useMemo,
useRef, useRef,
useState, useState,
} from 'react'; } from 'react';
@@ -597,61 +595,61 @@ function DashboardsList(): JSX.Element {
}, },
]; ];
const getCreateDashboardItems = useMemo(() => { // const getCreateDashboardItems = useMemo(() => {
const menuItems: MenuProps['items'] = [ // const menuItems: MenuProps['items'] = [
{ // {
label: ( // label: (
<div // <div
className="create-dashboard-menu-item" // className="create-dashboard-menu-item"
onClick={(): void => onModalHandler(false)} // onClick={(): void => onModalHandler(false)}
> // >
<Radius size={14} /> Import JSON // <Radius size={14} /> Import JSON
</div> // </div>
), // ),
key: '1', // key: '1',
}, // },
{ // {
label: ( // label: (
<a // <a
href="https://signoz.io/docs/dashboards/dashboard-templates/overview/" // href="https://signoz.io/docs/dashboards/dashboard-templates/overview/"
target="_blank" // target="_blank"
rel="noopener noreferrer" // rel="noopener noreferrer"
> // >
<Flex // <Flex
justify="space-between" // justify="space-between"
align="center" // align="center"
style={{ width: '100%' }} // style={{ width: '100%' }}
gap="small" // gap="small"
> // >
<div className="create-dashboard-menu-item"> // <div className="create-dashboard-menu-item">
<Github size={14} /> View templates // <Github size={14} /> View templates
</div> // </div>
<ExternalLink size={14} /> // <ExternalLink size={14} />
</Flex> // </Flex>
</a> // </a>
), // ),
key: '2', // key: '2',
}, // },
]; // ];
if (createNewDashboard) { // if (createNewDashboard) {
menuItems.unshift({ // menuItems.unshift({
label: ( // label: (
<div // <div
className="create-dashboard-menu-item" // className="create-dashboard-menu-item"
onClick={(): void => { // onClick={(): void => {
onNewDashboardHandler(); // onNewDashboardHandler();
}} // }}
> // >
<LayoutGrid size={14} /> Create dashboard // <LayoutGrid size={14} /> Create dashboard
</div> // </div>
), // ),
key: '0', // key: '0',
}); // });
} // }
return menuItems; // return menuItems;
}, [createNewDashboard, onNewDashboardHandler]); // }, [createNewDashboard, onNewDashboardHandler]);
const showPaginationItem = (total: number, range: number[]): JSX.Element => ( const showPaginationItem = (total: number, range: number[]): JSX.Element => (
<> <>
@@ -763,12 +761,6 @@ function DashboardsList(): JSX.Element {
{createNewDashboard && ( {createNewDashboard && (
<section className="actions"> <section className="actions">
<Dropdown
overlayClassName="new-dashboard-menu"
menu={{ items: getCreateDashboardItems }}
placement="bottomRight"
trigger={['click']}
>
<Button <Button
type="text" type="text"
className="new-dashboard" className="new-dashboard"
@@ -779,7 +771,6 @@ function DashboardsList(): JSX.Element {
> >
New Dashboard New Dashboard
</Button> </Button>
</Dropdown>
<Button <Button
type="text" type="text"
className="learn-more" className="learn-more"
@@ -807,23 +798,17 @@ function DashboardsList(): JSX.Element {
onChange={handleSearch} onChange={handleSearch}
/> />
{createNewDashboard && ( {createNewDashboard && (
<Dropdown
overlayClassName="new-dashboard-menu"
menu={{ items: getCreateDashboardItems }}
placement="bottomRight"
trigger={['click']}
>
<Button <Button
type="primary" type="primary"
className="periscope-btn primary btn" className="periscope-btn primary btn"
icon={<Plus size={14} />} icon={<Plus size={14} />}
onClick={(): void => { onClick={(): void => {
logEvent('Dashboard List: New dashboard clicked', {}); logEvent('Dashboard List: New dashboard clicked', {});
setShowNewDashboardTemplatesModal(true);
}} }}
> >
New dashboard New dashboard
</Button> </Button>
</Dropdown>
)} )}
</div> </div>