Skip to content

Commit f22f120

Browse files
committed
redesign
1 parent 2821875 commit f22f120

File tree

3 files changed

+54
-92
lines changed

3 files changed

+54
-92
lines changed

docusaurus.config.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,6 @@ module.exports = {
271271
return `https://github.com/SumoLogic/sumologic-documentation/issues/new?title=${query}`;
272272
},
273273
},
274-
announcementBar: {
275-
id: 'copilot',
276-
content: 'Check out 🤖 <b><a target="_blank" rel="noopener noreferrer" href="/docs/search/copilot">Sumo Logic Copilot</a></b>, our new AI-powered logs assistant!',
277-
backgroundColor: '#D3BAF7',
278-
textColor: '#000',
279-
},
280274
prism: {
281275
theme: lightCodeTheme,
282276
darkTheme: darkCodeTheme,

src/css/sumo.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ body, .MuiTypography-root, button, input, select, textarea {
232232
font-family: 'Lab Grotesque', sans-serif !important;
233233
}
234234

235+
#inline-chatbot-container iframe {
236+
height: 500px !important;
237+
}
238+
235239
//GitHub icon
236240
.header-github-link:hover {
237241
opacity: 0.6;

src/pages/index.tsx

Lines changed: 50 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ export const Home = () => {
2525
const [tab, setTab] = useState('0');
2626

2727
const questions = [
28-
'How can I set up alerts?',
29-
'What is real-time monitoring?',
30-
'How do I use dashboards?',
31-
'What types of logs can I analyze?',
32-
'How do I secure my environment?',
28+
'✨ How do I set up alerts?',
29+
'✨ What types of logs can I analyze?',
30+
'✨ How do I secure my environment?',
31+
'✨ How to navigate dashboards.'
3332
];
3433

3534
useEffect(() => {
@@ -46,66 +45,17 @@ export const Home = () => {
4645
token: widgetJwt,
4746
primaryColor: '#021b9a',
4847
position: { side: 'right', offsetX: 25, offsetY: 100 },
49-
isOpenByDefault: false,
48+
isOpenByDefault: true,
5049
botUrlPath: 'nova',
5150
showNewChat: true,
51+
parentElementId: 'inline-chatbot-container',
5252
});
53-
54-
// Inject dark mode styles as needed
55-
applyDarkModeStyles();
5653
};
5754

5855
script.onerror = () => console.error('Failed to load Berry widget script');
5956
}
60-
61-
// Inject dark mode styles on initial load
62-
applyDarkModeStyles();
63-
64-
// Listen for theme change events if your site supports dynamic theme switching
65-
window.addEventListener('themeChange', applyDarkModeStyles);
66-
67-
return () => {
68-
window.removeEventListener('themeChange', applyDarkModeStyles);
69-
};
7057
}, []);
7158

72-
const applyDarkModeStyles = () => {
73-
const isDarkMode = document.body.getAttribute('data-theme') === 'dark';
74-
const styleId = 'dark-mode-styles';
75-
76-
// Remove existing dark mode styles to avoid duplicates
77-
const existingStyle = document.getElementById(styleId);
78-
if (existingStyle) existingStyle.remove();
79-
80-
// Apply dark mode styles only if in dark mode
81-
if (isDarkMode) {
82-
const style = document.createElement('style');
83-
style.id = styleId;
84-
style.innerHTML = `
85-
body {
86-
background-color: #121212 !important;
87-
color: #ffffff !important;
88-
}
89-
a {
90-
color: #90caf9 !important;
91-
}
92-
.MuiButton-outlined {
93-
border-color: #90caf9 !important;
94-
color: #90caf9 !important;
95-
}
96-
.MuiButton-outlined:hover {
97-
background-color: #0045BE !important;
98-
color: #ffffff !important;
99-
}
100-
.MuiTypography-root {
101-
color: #ffffff !important;
102-
}
103-
/* Add more styles as necessary */
104-
`;
105-
document.head.appendChild(style);
106-
}
107-
};
108-
10959
const handleQuestionClick = (question) => {
11060
if (window.Berry) {
11161
if (window.Berry.sendMessage) {
@@ -152,41 +102,55 @@ export const Home = () => {
152102
</Typography>
153103

154104
{/* Suggested Questions */}
155-
<Box sx={{ width: '100%', bgcolor: '#f9f9f9', py: 4 }}>
105+
<Box sx={{ width: '100%', background: '#2a2a2a', color: '#fff', py: 4 }}>
156106
<Container maxWidth="md" sx={{ textAlign: 'center' }}>
157-
<Typography variant="h5" fontFamily="Lab Grotesque" fontWeight={700} mb={1}>
158-
Explore our new chatbot in the lower right corner!
159-
</Typography>
160-
<Typography variant="h5" fontFamily="Lab Grotesque" fontWeight={700} mb={2}>
161-
Try asking these questions to get started:
107+
<Typography variant="h4" fontFamily="Lab Grotesque" fontWeight={600} mb={1} sx={{ background: 'linear-gradient(90deg, #9900ED, #C04CF4, #00C8E0)', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent' }}>
108+
Your Sumo Docs assistant is here to help!
162109
</Typography>
163-
<Stack direction="row" spacing={2} justifyContent="center" flexWrap="wrap" rowGap={2}>
164-
{questions.map((question, index) => (
165-
<Button
166-
key={index}
167-
onClick={() => handleQuestionClick(question)}
168-
variant="outlined"
169-
sx={{
170-
bgcolor: 'white',
171-
color: '#0045BE',
172-
fontFamily: 'Lab Grotesque',
173-
borderColor: '#0045BE',
174-
'&:hover': {
175-
bgcolor: '#0045BE',
176-
color: 'white',
177-
},
178-
}}
179-
>
180-
{question}
181-
</Button>
182-
))}
183-
</Stack>
184-
<Typography variant="body2" color="textSecondary" mt={2}>
185-
*Click on the chat icon <ChatIcon fontSize="small" /> in the bottom right if the chatbot does not open automatically.
110+
<Typography fontFamily="Lab Grotesque" fontSize={15} fontWeight={300} mb={2}>
111+
Ask me a question! Try these to get started:
186112
</Typography>
113+
<Stack
114+
direction="row"
115+
spacing={1} // Reduced horizontal spacing between buttons
116+
justifyContent="center"
117+
flexWrap="wrap"
118+
rowGap={1} // Reduced vertical spacing between rows
119+
>
120+
121+
{questions.map((question, index) => (
122+
<Button
123+
key={index}
124+
onClick={() => handleQuestionClick(question)}
125+
variant="outlined"
126+
sx={{
127+
bgcolor: 'transparent',
128+
color: '#DDDDDD',
129+
fontFamily: 'Lab Grotesque',
130+
borderColor: '#808080',
131+
borderRadius: '5px',
132+
textTransform: 'lowercase',
133+
fontSize: '12px',
134+
fontWeight: '300',
135+
padding: '4px 6px',
136+
minWidth: 'auto',
137+
'&:hover': {
138+
bgcolor: '#2a2a2a',
139+
color: '#DDDDDD',
140+
},
141+
}}
142+
>
143+
{question}
144+
</Button>
145+
))}
146+
</Stack>
147+
148+
{/* Inline Chatbot Container */}
149+
<Box id="inline-chatbot-container" sx={{ my: 4, p: 2, margin: '0 auto', textAlign: 'center' }}>
150+
{/* The chatbot will render here */}
151+
</Box>
187152
</Container>
188153
</Box>
189-
190154
{/* Hero */}
191155
<Stack
192156
sx={{

0 commit comments

Comments
 (0)