Skip to content

Commit

Permalink
fix toolbar spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuignoto committed Mar 4, 2024
1 parent c7694e7 commit 8e4ee86
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 28 deletions.
4 changes: 4 additions & 0 deletions src/components/elements/popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const PopOver: FunctionComponent<PopOverModel> = ({
}
}, [open]);

useEffect(() => {
console.log('$isMobile: ', theme);
}, [$isMobile]);

return (
<PopoverWrapper ref={ref}>
<Selecter
Expand Down
1 change: 1 addition & 0 deletions src/components/elements/popover/popover.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const SelecterIcon = styled.span<{ open: boolean; theme: Theme }>`
export const SelecterLabel = styled.span`
font-size: 0.9rem;
text-align: left;
white-space: nowrap;
`;

export const Header = styled.div`
Expand Down
32 changes: 5 additions & 27 deletions src/components/timeline/timeline-popover-elements.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
import { Theme } from '@models/Theme';
import { TextDensity, TimelineMode } from '@models/TimelineModel';
import { FunctionComponent, useContext, useMemo } from 'react';
import { GlobalContext } from '../GlobalContext';
import { List } from '../elements/list/list';
import { ListItemModel } from '../elements/list/list.model';
import { PopOver } from '../elements/popover';
import { ArrowDownIcon, LayoutIcon, ParaIcon } from '../icons';

type CommonProps = {
isDarkMode: boolean;
isMobile: boolean;
position: 'top' | 'bottom';
theme: Theme;
};

type LayoutSwitcherProp = {
initialTimelineMode?: TimelineMode | 'HORIZONTAL_ALL';
mode?: TimelineMode;
onUpdateTimelineMode: (s: string) => void;
} & CommonProps;

type QuickJumpProp = {
activeItem: number;
items: ListItemModel[];
onActivateItem: (id: string) => void;
} & CommonProps;

type ChangeDensityProp = {
onChange: (value: TextDensity) => void;
selectedDensity: TextDensity;
} & CommonProps;
import {
ChangeDensityProp,
LayoutSwitcherProp,
QuickJumpProp,
} from './timeline-popover.model';

const LayoutSwitcher: FunctionComponent<LayoutSwitcherProp> = ({
onUpdateTimelineMode,
Expand Down
27 changes: 27 additions & 0 deletions src/components/timeline/timeline-popover.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Theme } from '@models/Theme';
import { TextDensity, TimelineMode } from '@models/TimelineModel';
import { ListItemModel } from '../elements/list/list.model';

export type CommonProps = {
isDarkMode: boolean;
isMobile: boolean;
position: 'top' | 'bottom';
theme: Theme;
};

export type LayoutSwitcherProp = {
initialTimelineMode?: TimelineMode | 'HORIZONTAL_ALL';
mode?: TimelineMode;
onUpdateTimelineMode: (s: string) => void;
} & CommonProps;

export type QuickJumpProp = {
activeItem: number;
items: ListItemModel[];
onActivateItem: (id: string) => void;
} & CommonProps;

export type ChangeDensityProp = {
onChange: (value: TextDensity) => void;
selectedDensity: TextDensity;
} & CommonProps;
1 change: 1 addition & 0 deletions src/components/timeline/timeline.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,6 @@ export const ExtraControls = styled.ul<{

export const ExtraControlChild = styled.li`
display: flex;
margin: 0.5rem 0;
margin-right: 0.5rem;
`;
1 change: 0 additions & 1 deletion src/models/TimelineModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ export type TimelineProps = {

// enables the read more button
useReadMore?: boolean;

};

export type SlideShowType = 'reveal' | 'slide_in' | 'slide_from_sides';
Expand Down

0 comments on commit 8e4ee86

Please sign in to comment.