Skip to content

Commit 31917f3

Browse files
author
ci-bot
committed
fixes bugs
1 parent ed5442d commit 31917f3

File tree

9 files changed

+163
-123
lines changed

9 files changed

+163
-123
lines changed

apps/learneth/src/components/RepoImporter/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
.repo-label .fa-question-circle {
32-
transform: translateY(-1px);
32+
transform: translateY(1px);
3333
}
3434

3535
.repo-importer-container .dropdown-item {

apps/learneth/src/components/RepoImporter/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function RepoImporter({ list, selectedRepo }: any): JSX.Element {
107107
<Form.Label className="repo-label d-flex align-items-center" htmlFor="name">
108108
REPO REFERENCE
109109
<CustomTooltip placement="top" tooltipId="learnethQuestionIconTooltip" tooltipText='i.e. username/repository'>
110-
<i className="fas fa-question-circle ms-2" />
110+
<i className="fas fa-question-circle ms-1" />
111111
</CustomTooltip>
112112
</Form.Label>
113113
<Form.Control

apps/learneth/src/pages/Home/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@
6060
}
6161
#learneth .remixui_pluginSearchInput {
6262
height: 38px;
63+
}
64+
#learneth .text-primary {
65+
filter: brightness(150%);
6366
}

apps/learneth/src/pages/Home/index.tsx

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ function HomePage(): JSX.Element {
6161

6262
const allTags = useMemo(() => {
6363
if (!selectedRepo) return []
64-
const set = new Set<string>()
64+
const tagSet = new Set<string>()
6565
Object.values(selectedRepo.entities).forEach((entity: any) => {
6666
const tags: string[] = entity?.metadata?.data?.tags || []
67-
tags.forEach(t => set.add(t))
67+
tags.forEach(t => {
68+
tagSet.add(t === 'Remix-IDE' ? 'Remix' : t)
69+
})
6870
})
69-
return Array.from(set).sort((a, b) => a.localeCompare(b))
71+
return Array.from(tagSet).sort((a, b) => a.localeCompare(b))
7072
}, [selectedRepo])
7173

7274
const flatItems = useMemo(() => {
@@ -112,13 +114,17 @@ function HomePage(): JSX.Element {
112114
list = list.filter(r => set.has(r.levelNum))
113115
}
114116
if (selectedTags.length) {
115-
list = list.filter(r => r.tags.some(t => selectedTags.includes(t)))
117+
const filterTags = new Set(selectedTags)
118+
if (filterTags.has('Remix')) {
119+
filterTags.add('Remix-IDE')
120+
}
121+
list = list.filter(r => r.tags.some(t => filterTags.has(t)))
116122
}
117123
return list
118124
}, [flatItems, debouncedSearch, selectedLevels, selectedTags])
119125

120126
return (
121-
<div id="learneth" className="App mb-5">
127+
<div id="learneth" className="App mb-5 container-fluid">
122128
<RepoImporter list={list} selectedRepo={selectedRepo || {}} />
123129
<div className="container-fluid mb-3">
124130
<hr className="my-3"/>
@@ -161,24 +167,30 @@ function HomePage(): JSX.Element {
161167

162168
{selectedRepo && (
163169
<div className="container-fluid">
164-
{filtered.map((r) => (
165-
<article key={r.id} className="card card-hover mb-3 border overflow-hidden">
166-
<div className="card-header d-flex justify-content-between align-items-center bg-transparent px-3 py-2">
167-
<div className="d-flex align-items-center">
168-
<Antenna level={r.levelNum} />
169-
<span className="small fw-medium text-body-emphasis">{r.levelText}</span>
170-
170+
{filtered.length > 0 ? (
171+
filtered.map((r) => (
172+
<article key={r.id} className="card card-hover mb-3 border overflow-hidden">
173+
<div className="card-header d-flex justify-content-between align-items-center bg-transparent px-3 py-2">
174+
<div className="d-flex align-items-center">
175+
<Antenna level={r.levelNum} />
176+
<span className="small fw-medium text-body-emphasis">{r.levelText}</span>
177+
</div>
178+
<MetaRight stepsLen={r.stepsLen} duration={r.duration} />
179+
</div>
180+
<div className="card-body">
181+
<h5 className="card-title mb-1 title-clamp-2 text-body-emphasis">{r.name}</h5>
182+
{!!r.subtitle && <p className="text-body-secondary small mb-2 subtitle-clamp-1 text-body-emphasis">{r.subtitle}</p>}
183+
<p className="mt-2 mb-0 text-muted body-clamp-4">{r.preview}</p>
184+
<Link to={`/list?id=${r.id}`} className="stretched-link" onClick={() => (window as any)._paq.push(['trackEvent', 'learneth', 'start_workshop', r.name])}/>
171185
</div>
172-
<MetaRight stepsLen={r.stepsLen} duration={r.duration} />
173-
</div>
174-
<div className="card-body">
175-
<h5 className="card-title mb-1 title-clamp-2 text-body-emphasis">{r.name}</h5>
176-
{!!r.subtitle && <p className="text-body-secondary small mb-2 subtitle-clamp-1 text-body-emphasis">{r.subtitle}</p>}
177-
<p className="mt-2 mb-0 text-muted body-clamp-4">{r.preview}</p>
178-
<Link to={`/list?id=${r.id}`} className="stretched-link" onClick={() => (window as any)._paq.push(['trackEvent', 'learneth', 'start_workshop', r.name])}/>
179-
</div>
180-
</article>
181-
))}
186+
</article>
187+
))
188+
) : (
189+
<div className="text-center text-muted mt-5 p-3">
190+
<h5 className="fw-bold">No tutorials found</h5>
191+
<p className="mb-0">Please try adjusting your search or filter criteria.</p>
192+
</div>
193+
)}
182194
</div>
183195
)}
184196
</div>

apps/learneth/src/pages/StepDetail/index.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ h1 {
2626
text-align: left;
2727
font-size: 1.2rem !important;
2828
word-break: break-word;
29+
margin-top: 7rem !important;
30+
2931
}
3032

3133
markdown {
@@ -51,4 +53,22 @@ markdown {
5153
}
5254
}
5355

56+
.nav .nav-link.btn-info {
57+
background-color: var(--bs-info);
58+
color: white;
59+
}
60+
61+
.nav .nav-link.btn-warning {
62+
background-color: var(--bs-warning);
63+
color: #000;
64+
}
5465

66+
.nav .nav-link.btn-success {
67+
background-color: var(--bs-success);
68+
color: white;
69+
}
70+
71+
.nav .nav-link[class*="btn-"]:hover {
72+
filter: brightness(90%);
73+
transition: filter 0.2s ease-in-out;
74+
}

apps/learneth/src/pages/StepDetail/index.tsx

Lines changed: 100 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -108,90 +108,92 @@ function StepDetailPage() {
108108
</div>
109109
{clonedStep.test?.content ? (
110110
<>
111-
<nav className="nav nav-pills nav-fill">
112-
{errorLoadingFile ? (
113-
<button
114-
className="nav-item rounded-0 nav-link btn btn-warning test"
115-
onClick={() => {
116-
dispatch({
117-
type: 'remixide/displayFile',
118-
payload: clonedStep,
119-
})
120-
}}
121-
>
122-
Load the file
123-
</button>
124-
) : (
125-
<>
126-
{!errorLoadingFile ? (
127-
<>
128-
<button
129-
className="nav-item rounded-0 nav-link btn btn-info test"
130-
onClick={() => {
131-
dispatch({
132-
type: 'remixide/testStep',
133-
payload: clonedStep,
134-
})
135-
}}
136-
>
137-
Check Answer
138-
</button>
139-
{clonedStep.answer?.content && (
111+
<div className="mt-3 px-2">
112+
<nav className="nav nav-pills nav-fill">
113+
{errorLoadingFile ? (
114+
<button
115+
className="nav-item rounded-0 nav-link btn btn-warning test"
116+
onClick={() => {
117+
dispatch({
118+
type: 'remixide/displayFile',
119+
payload: clonedStep,
120+
})
121+
}}
122+
>
123+
Load the file
124+
</button>
125+
) : (
126+
<>
127+
{!errorLoadingFile ? (
128+
<>
140129
<button
141-
className="nav-item rounded-0 nav-link btn btn-warning test"
130+
className="nav-item rounded-0 nav-link btn btn-info test"
142131
onClick={() => {
143132
dispatch({
144-
type: 'remixide/showAnswer',
133+
type: 'remixide/testStep',
145134
payload: clonedStep,
146135
})
147136
}}
148137
>
149-
Show answer
138+
Check Answer
150139
</button>
151-
)}
152-
</>
153-
) : (
154-
<>
155-
{!errorLoadingFile && (
156-
<>
140+
{clonedStep.answer?.content && (
157141
<button
158-
className="nav-item rounded-0 nav-link btn btn-success test"
142+
className="nav-item rounded-0 nav-link btn btn-warning test"
159143
onClick={() => {
160-
navigate(stepId === steps.length - 1 ? `/list?id=${id}` : `/detail?id=${id}&stepId=${stepId + 1}`)
144+
dispatch({
145+
type: 'remixide/showAnswer',
146+
payload: clonedStep,
147+
})
161148
}}
162149
>
163-
Next
150+
Show answer
164151
</button>
165-
{clonedStep.answer?.content && (
152+
)}
153+
</>
154+
) : (
155+
<>
156+
{!errorLoadingFile && (
157+
<>
166158
<button
167-
className="nav-item rounded-0 nav-link btn btn-warning test"
159+
className="nav-item rounded-0 nav-link btn btn-success test"
168160
onClick={() => {
169-
dispatch({
170-
type: 'remixide/showAnswer',
171-
payload: clonedStep,
172-
})
161+
navigate(stepId === steps.length - 1 ? `/list?id=${id}` : `/detail?id=${id}&stepId=${stepId + 1}`)
173162
}}
174163
>
175-
Show answer
164+
Next
176165
</button>
177-
)}
178-
</>
179-
)}
180-
</>
181-
)}
182-
</>
166+
{clonedStep.answer?.content && (
167+
<button
168+
className="nav-item rounded-0 nav-link btn btn-warning test"
169+
onClick={() => {
170+
dispatch({
171+
type: 'remixide/showAnswer',
172+
payload: clonedStep,
173+
})
174+
}}
175+
>
176+
Show answer
177+
</button>
178+
)}
179+
</>
180+
)}
181+
</>
182+
)}
183+
</>
184+
)}
185+
</nav>
186+
{success && (
187+
<button
188+
className="w-100 rounded-0 nav-item nav-link btn btn-success"
189+
onClick={() => {
190+
navigate(stepId === steps.length - 1 ? `/list?id=${id}` : `/detail?id=${id}&stepId=${stepId + 1}`)
191+
}}
192+
>
193+
Next
194+
</button>
183195
)}
184-
</nav>
185-
{success && (
186-
<button
187-
className="w-100 rounded-0 nav-item nav-link btn btn-success"
188-
onClick={() => {
189-
navigate(stepId === steps.length - 1 ? `/list?id=${id}` : `/detail?id=${id}&stepId=${stepId + 1}`)
190-
}}
191-
>
192-
Next
193-
</button>
194-
)}
196+
</div>
195197
<div id="errors">
196198
{success && (
197199
<div className="alert rounded-0 alert-success mb-0 mt-0" role="alert">
@@ -216,43 +218,45 @@ function StepDetailPage() {
216218
</>
217219
) : (
218220
<>
219-
<nav className="nav nav-pills nav-fill">
220-
{!errorLoadingFile && clonedStep.answer?.content && (
221+
<div className="mt-3 px-2">
222+
<nav className="nav nav-pills nav-fill">
223+
{!errorLoadingFile && clonedStep.answer?.content && (
224+
<button
225+
className="nav-item rounded-0 nav-link btn btn-warning test"
226+
onClick={() => {
227+
dispatch({
228+
type: 'remixide/showAnswer',
229+
payload: clonedStep,
230+
})
231+
}}
232+
>
233+
Show answer
234+
</button>
235+
)}
236+
</nav>
237+
{stepId < steps.length - 1 && (
221238
<button
222-
className="nav-item rounded-0 nav-link btn btn-warning test"
239+
className="w-100 btn btn-success mt-3"
223240
onClick={() => {
224-
dispatch({
225-
type: 'remixide/showAnswer',
226-
payload: clonedStep,
227-
})
241+
navigate(`/detail?id=${id}&stepId=${stepId + 1}`);
242+
(window as any)._paq.push(['trackEvent', 'learneth', 'navigate_next', `${id}/${stepId + 1}`])
228243
}}
229244
>
230-
Show answer
245+
Next
231246
</button>
232247
)}
233-
</nav>
234-
{stepId < steps.length - 1 && (
235-
<button
236-
className="w-100 btn btn-success"
237-
onClick={() => {
238-
navigate(`/detail?id=${id}&stepId=${stepId + 1}`);
239-
(window as any)._paq.push(['trackEvent', 'learneth', 'navigate_next', `${id}/${stepId + 1}`])
240-
}}
241-
>
242-
Next
243-
</button>
244-
)}
245-
{stepId === steps.length - 1 && (
246-
<button
247-
className="w-100 btn btn-success"
248-
onClick={() => {
249-
navigate(`/list?id=${id}`);
250-
(window as any)._paq.push(['trackEvent', 'learneth', 'navigate_finish', id])
251-
}}
252-
>
253-
Finish tutorial
254-
</button>
255-
)}
248+
{stepId === steps.length - 1 && (
249+
<button
250+
className="w-100 btn btn-success"
251+
onClick={() => {
252+
navigate(`/list?id=${id}`);
253+
(window as any)._paq.push(['trackEvent', 'learneth', 'navigate_finish', id])
254+
}}
255+
>
256+
Finish tutorial
257+
</button>
258+
)}
259+
</div>
256260
</>
257261
)}
258262
</div>

apps/remix-ide/src/app/panels/layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export class Layout extends Plugin {
3737
super(profile)
3838
this.maximized = {
3939
// 'remixaiassistant': true
40+
'LearnEth': true,
4041
}
4142
this.enhanced = {
4243
'dgit': true,
43-
'LearnEth': true,
4444
'remixaiassistant': true
4545
}
4646
this.event = new EventEmitter()

libs/remix-ui/plugin-manager/src/lib/components/PluginCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function PluginCard({ profile, isActive, isLoading, togglePlugin }: PluginCardPr
4141
<ToggleSwitch
4242
id={`toggleSwitch-${profile.name}`}
4343
isOn={isActive}
44+
onClick={()=>{}}
4445
/>
4546
</div>
4647
</div>

0 commit comments

Comments
 (0)