diff --git a/client/web/src/tour/components/ItemPicker.tsx b/client/web/src/tour/components/ItemPicker.tsx index b49e3ffb335..2166d90d68b 100644 --- a/client/web/src/tour/components/ItemPicker.tsx +++ b/client/web/src/tour/components/ItemPicker.tsx @@ -8,22 +8,26 @@ import { Button } from '@sourcegraph/wildcard' import styles from './ItemPicker.module.scss' interface ItemPickerProps { + title: string items: TItem[] onClose: () => void onSelect: (language: TItem) => void + className?: string } /** * ItemPicker component. Displays a closable block with list of items passed. */ export const ItemPicker = ({ + title, items, onClose, onSelect, + className, }: ItemPickerProps): React.ReactElement => ( -
+
-

Please select a language:

+

{title}

diff --git a/client/web/src/tour/components/Tour/Tour.module.scss b/client/web/src/tour/components/Tour/Tour.module.scss index 21f794aa568..f2f19bb47ae 100644 --- a/client/web/src/tour/components/Tour/Tour.module.scss +++ b/client/web/src/tour/components/Tour/Tour.module.scss @@ -1,3 +1,4 @@ +@import 'wildcard/src/global-styles/breakpoints'; :global(.theme-light) { --getting-started-tour-oc-blue-bg: var(--oc-blue-1); --getting-started-tour-oc-blue-border: var(--oc-blue-2); @@ -24,15 +25,7 @@ .task-list { &::-webkit-scrollbar { - /* stylelint-disable-next-line declaration-property-unit-allowed-list */ - width: 4px; - /* stylelint-disable-next-line declaration-property-unit-allowed-list */ - height: 4px; - } - - &::-webkit-scrollbar-thumb { - border-radius: 3px; - box-shadow: inset 0 0 6px var(--text-muted); + display: none; } &.is-horizontal { @@ -42,14 +35,6 @@ scroll-behavior: smooth; padding-bottom: 0.5rem; - &::-webkit-scrollbar-thumb { - visibility: hidden; - } - - &:hover::-webkit-scrollbar-thumb { - visibility: visible; - } - > * { flex: 1 0 19rem; scroll-snap-align: start; @@ -65,7 +50,6 @@ &:not(.is-horizontal) { overflow-y: auto; flex-grow: 1; - padding-right: 0.25rem; > :not(:last-child)::after { content: ' '; @@ -77,15 +61,7 @@ // Firefox custom scrollbar @-moz-document url-prefix('') { - scrollbar-width: thin; - scrollbar-color: var(--text-muted); - &.is-horizontal { - padding-bottom: 1rem; - } - - &:not(.is-horizontal) { - padding-right: 0.5rem; - } + scrollbar-width: none; } } @@ -113,6 +89,18 @@ } } +.completed-items { + flex-grow: 2 !important; + + &-inner { + display: flex; + gap: 7.5rem; + + @media (--md-breakpoint-down) { + gap: 2rem; + } + } +} .completed-check-icon { margin-top: 0.125rem; } @@ -126,7 +114,11 @@ color: var(--link-color); font-weight: bold; display: inline-block; - padding: 0 0.25rem 0 0.5rem; + padding: 0 0.25rem 0 0; + + .is-small & { + padding-left: 0.5rem; + } } .step-list-item { diff --git a/client/web/src/tour/components/Tour/TourContent.tsx b/client/web/src/tour/components/Tour/TourContent.tsx index 289d8d52733..6a2db755328 100644 --- a/client/web/src/tour/components/Tour/TourContent.tsx +++ b/client/web/src/tour/components/Tour/TourContent.tsx @@ -45,10 +45,10 @@ const Footer: React.FunctionComponent<{ completedCount: number; totalCount: numb ) const CompletedItem: React.FunctionComponent = ({ children }) => ( -
+
  • {children} -
  • + ) export const TourContent: React.FunctionComponent = ({ @@ -58,7 +58,7 @@ export const TourContent: React.FunctionComponent = ({ className, height = 18, }) => { - const { completedCount, totalCount, completedTaskChunks, completedTasks, ongoingTasks } = useMemo(() => { + const { completedCount, totalCount, completedTasks, completedTaskChunks, ongoingTasks } = useMemo(() => { const completedTasks = tasks.filter(task => task.completed === 100) return { completedTasks, @@ -68,15 +68,16 @@ export const TourContent: React.FunctionComponent = ({ completedCount: completedTasks.length, } }, [tasks]) + const isHorizontal = variant === 'horizontal' return (
    - {variant === 'horizontal' &&
    Don't show again
    } + {isHorizontal &&
    Don't show again
    } - {variant !== 'horizontal' &&
    } + {!isHorizontal &&
    }
    = ({ // eslint-disable-next-line react/forbid-dom-props style={{ maxHeight: `${height}rem` }} > - {variant === 'horizontal' && - completedTaskChunks.length > 0 && - completedTaskChunks.map((completedTaskChunk, index) => ( -
    - {variant === 'horizontal' && index === 0 &&

    Completed

    } - {completedTaskChunk.map(completedTask => ( - {completedTask.title} + {isHorizontal && completedTaskChunks.length > 0 && ( +
    +

    Completed

    +
    + {completedTaskChunks.map((completedTaskChunk, index) => ( +
      + {completedTaskChunk.map(completedTask => ( + + {completedTask.title} + + ))} +
    ))}
    - ))} +
    + )} {ongoingTasks.map(task => ( - + ))} - {variant !== 'horizontal' && completedTasks.length > 0 && ( + {!isHorizontal && completedTasks.length > 0 && (
    {completedTasks.map(completedTask => ( {completedTask.title} @@ -106,9 +113,9 @@ export const TourContent: React.FunctionComponent = ({
    )}
    - {variant !== 'horizontal' &&
    } + {!isHorizontal &&
    } - {variant === 'horizontal' &&
    } + {isHorizontal &&
    }
    ) } diff --git a/client/web/src/tour/components/Tour/TourTask.tsx b/client/web/src/tour/components/Tour/TourTask.tsx index 5e1add4a79f..b95892fe2ac 100644 --- a/client/web/src/tour/components/Tour/TourTask.tsx +++ b/client/web/src/tour/components/Tour/TourTask.tsx @@ -73,7 +73,13 @@ export const TourTask: React.FunctionComponent = ({ title, steps, if (showLanguagePicker) { return ( - + ) } @@ -94,7 +100,7 @@ export const TourTask: React.FunctionComponent = ({ title, steps, className={classNames( styles.stepList, 'm-0', - variant !== 'small' && 'flex-grow-1 d-flex flex-column justify-content-center', + variant !== 'small' && 'flex-grow-1 d-flex flex-column', isMultiStep && styles.isMultiStep )} > diff --git a/client/web/src/tour/data/index.tsx b/client/web/src/tour/data/index.tsx index f3d6ca011dd..92f08f0e255 100644 --- a/client/web/src/tour/data/index.tsx +++ b/client/web/src/tour/data/index.tsx @@ -260,7 +260,7 @@ export const authenticatedTasks: TourTaskType[] = [ }, { id: 'DiffSearch', - label: 'Learn how to find and fix vulnerabilities faster', + label: 'Find problematic code in diffs', action: { type: 'link', value: {