Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed one major change and a few minor changes #291

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion components/ClassPage/ClassPageInfoBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GetClassPageInfoQuery } from '../../generated/graphql';
import { getCampusByLastDigit, getSeason, getYear } from '../terms';
import { Campus } from '../types';
import HeaderBody from './HeaderBody';
import removeHTMLTags from '../../utils/removeHTMLTags';

type ClassPageInfoProp = {
classPageInfo: GetClassPageInfoQuery;
Expand All @@ -18,7 +19,7 @@ export default function ClassPageInfoBody({
<div className="classPageBodyLeft">
<HeaderBody
header="COURSE DESCRIPTION"
body={<p>{latestOccurrence.desc}</p>}
body={<p>{removeHTMLTags(latestOccurrence.desc)}</p>}
/>
<HeaderBody
header="COURSE LEVEL"
Expand Down
2 changes: 1 addition & 1 deletion components/ClassPage/ClassPageReqsBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function ClassPageReqsBody({
className="link"
body={
<a href={latestOccurrence.prettyUrl}>
Click here to view this course on the Northeastern website.
Click here to view this course on the Northeastern website
</a>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion components/ClassPage/PageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function PageContent({
</h2>
) : (
<div className="backToResults" onClick={() => router.back()}>
Back to Search Results
Back
</div>
)}
{classPageInfo && classPageInfo.class && (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "concurrently -n app,codegen \"next dev -p 5000\" \"npm:generate:graphql -- --watch\"",
"dev": "concurrently -n app,codegen \"next dev -p 5001\" \"npm:generate:graphql -- --watch\"",
"dev:fullstack": "NEXT_PUBLIC_GRAPHQL_ENDPOINT=http://localhost:4000 NEXT_PUBLIC_NOTIFS_ENDPOINT=http://localhost:8080 yarn run dev",
"build": "next build",
"vercel:build": "yarn build",
Expand Down
2 changes: 1 addition & 1 deletion styles/_FilterPills.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
&__row {
display: flex;
margin-bottom: -5px;
padding: 10px 15px;
// padding: 10px 15px;
max-width: 75vw;
margin-left: 5px;
padding-left: 0;
Expand Down
1 change: 1 addition & 0 deletions styles/_LastUpdated.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
.updatedText {
font-family: Lato;
font-weight: 400;
margin-left: 5px
}
4 changes: 0 additions & 4 deletions styles/_Toast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
white-space: nowrap;
}

.link {
text-decoration: underline;
}

.toast-bottom-left {
bottom: 40px;
left: 48px;
Expand Down
11 changes: 7 additions & 4 deletions styles/pages/_ClassPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
}

.backToResults {
height: 38px;
font-size: 17px;
font-size: 18px;
cursor: pointer;
color: Colors.$Blue;

padding: 2px 3px 2px 3px;
border-radius: 10%;
width: fit-content;
margin-bottom: 40px;
&:hover {
text-decoration: underline;
background-color: Colors.$Blue;
color: white
}
}

Expand Down
10 changes: 10 additions & 0 deletions utils/removeHTMLTags.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default function removeHTMLTags(htmlString: string) {
// Create a new DOMParser instance
const parser = new DOMParser();
// Parse the HTML string
const doc = parser.parseFromString(htmlString, 'text/html');
// Extract text content
const textContent = doc.body.textContent || "";
// Trim whitespace
return textContent.trim();
}