@@ -7,6 +7,7 @@ import { useEffect, useState } from "react";
77import { usePlaygroundContext } from "../PlaygroundContext" ;
88import ModalPopup from '@/app/components/ModalPopup' ;
99import ImageIcon from "@/app/components/ImageIcon" ;
10+ import { useBasePath } from "@/app/utils/useBasePath" ;
1011
1112import PgQueryTemplate from '../PgQueryTemplate' ;
1213
@@ -17,32 +18,13 @@ const labels = {
1718 replayTour : "Replay Tour"
1819}
1920
20- const linkItems = [
21- {
22- label : "Docs" ,
23- //icon: "fa fa-book",
24- url : "https://redis.io/docs/latest/" ,
25- image : "/icons/profiler.svg"
26- } ,
27- {
28- label : "Redis University" ,
29- //icon: "fa fa-user-graduate",
30- url : "https://university.redis.io/" ,
31- image : "/icons/university.svg"
32- } ,
33- {
34- label : "Redis Cloud" ,
35- //icon: "fa fa-cloud",
36- url : "https://cloud.redis.io/" ,
37- image : "/icons/cloud-midnight.svg"
38- } ,
39- ]
40-
4121const PgSidebar = ( ) => {
4222 const { selectedQuery, setSelectedQuery, fnGetSelectedQueryTemplate, runTour, setRunTour, fnSetTourCompleted } = usePlaygroundContext ( ) ;
4323 const [ selectedCategory , setSelectedCategory ] = useState < IQueryTemplateData | null > ( null ) ;
4424 const [ modalIsOpen , setModalIsOpen ] = useState ( false ) ;
4525
26+ const basePath = useBasePath ;
27+
4628 useEffect ( ( ) => {
4729 if ( selectedQuery ) {
4830 const result = fnGetSelectedQueryTemplate ( ) ;
@@ -60,6 +42,23 @@ const PgSidebar = () => {
6042 setRunTour ( true ) ;
6143 }
6244
45+ const linkItems = [
46+ {
47+ label : "Docs" ,
48+ url : "https://redis.io/docs/latest/" ,
49+ image : basePath ( "/icons/profiler.svg" )
50+ } ,
51+ {
52+ label : "Redis University" ,
53+ url : "https://university.redis.io/" ,
54+ image : basePath ( "/icons/university.svg" )
55+ } ,
56+ {
57+ label : "Redis Cloud" ,
58+ url : "https://cloud.redis.io/" ,
59+ image : basePath ( "/icons/cloud-midnight.svg" )
60+ } ,
61+ ]
6362
6463 return < div className = "pg-sidebar" >
6564
@@ -69,8 +68,7 @@ const PgSidebar = () => {
6968 </ div >
7069 < div className = "pg-list-item anime-line-hover" onClick = { ( ) => setModalIsOpen ( true ) } >
7170 < div className = "pg-list-item-icon" >
72- { /* <i className="fa fa-arrows-up-down-left-right"></i> */ }
73- < ImageIcon imgSrc = "/icons/move.svg" alt = "move" imgWidth = "1rem" imgHeight = "1rem" />
71+ < ImageIcon imgSrc = { basePath ( "/icons/move.svg" ) } alt = "move" imgWidth = "1rem" imgHeight = "1rem" />
7472 </ div >
7573 < div className = "pg-list-item-label select-query-label" >
7674 { labels . selectQuery }
@@ -91,8 +89,7 @@ const PgSidebar = () => {
9189 onClick = { ( ) => handleQueryItemClick ( item . queryId , selectedCategory ?. categoryId ) } >
9290
9391 < div className = "pg-list-item-icon" >
94- { /* <i className="fa fa-arrow-right"></i> */ }
95- < ImageIcon imgSrc = "/icons/arrow-right-slim.svg" alt = { item . label } imgWidth = "1rem" imgHeight = "1rem" />
92+ < ImageIcon imgSrc = { basePath ( "/icons/arrow-right-slim.svg" ) } alt = { item . label } imgWidth = "1rem" imgHeight = "1rem" />
9693 </ div >
9794 < div className = "pg-list-item-label" >
9895 { item . label }
@@ -113,7 +110,6 @@ const PgSidebar = () => {
113110 { linkItems . map ( item => (
114111 < div className = "pg-list-item anime-line-hover" key = { item . label } onClick = { ( ) => window . open ( item . url , '_blank' , 'noopener,noreferrer' ) } >
115112 < div className = "pg-list-item-icon" >
116- { /* <i className={item.icon}></i> */ }
117113 < ImageIcon imgSrc = { item . image } alt = { item . label } imgWidth = "1rem" imgHeight = "1rem" />
118114 </ div >
119115 < div className = "pg-list-item-label" >
@@ -124,8 +120,7 @@ const PgSidebar = () => {
124120
125121 < div className = "pg-list-item anime-line-hover" key = "replay-tour" onClick = { handleReplayTourClick } >
126122 < div className = "pg-list-item-icon" >
127- { /* <i className="fa fa-rotate"></i> */ }
128- < ImageIcon imgSrc = "/icons/refresh.svg" alt = "rotate" imgWidth = "1rem" imgHeight = "1rem" />
123+ < ImageIcon imgSrc = { basePath ( "/icons/refresh.svg" ) } alt = "rotate" imgWidth = "1rem" imgHeight = "1rem" />
129124 </ div >
130125 < div className = "pg-list-item-label pg-replay-tour-lbl" >
131126 { labels . replayTour }
0 commit comments