Skip to content

Commit

Permalink
add table header and change button text
Browse files Browse the repository at this point in the history
  • Loading branch information
egsch committed Nov 26, 2024
1 parent a85d201 commit d33165a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ export async function insertEventToGoogleCalendar(event) {
},
);
} catch (error) {
console.error(error);
console.error(error);
}
}
6 changes: 1 addition & 5 deletions src/components/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ const storage = new Storage({
area: 'local',
});




const Landing = () => {
const [page, setPage] = useState(0);
useEffect(() => {
Expand All @@ -89,7 +86,7 @@ const Landing = () => {
},
});
}, []);

switch (page) {
case 0:
return (
Expand Down Expand Up @@ -138,7 +135,6 @@ const Landing = () => {
>
Get Started
</Button>

</div>
</div>
);
Expand Down
16 changes: 12 additions & 4 deletions src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,18 @@ export async function scrapeCourseData() {
chrome.storage.local.get('token', async function (tokenStored) {
console.log(tokenStored);
if (typeof tokenStored.token !== 'undefined') {
// add Save to Skedge
// add Save to Google Calendar
const newHeader2 = document.createElement('th');
const saveLine = document.createElement('div');
line1.innerText = 'Save';
saveLine.innerText = 'Save to \nGoogle Calendar';
newHeader2.append(saveLine);

// add Skedge reminder
const calLine2 = document.createElement('div');
calLine2.style.fontWeight = 'normal';
calLine2.style.paddingTop = '0.5rem';
calLine2.innerText = 'From Skedge';
newHeader2.append(calLine2);
tableHeaders.insertBefore(newHeader2, tableHeaders.children[1]);
}
});
Expand Down Expand Up @@ -132,8 +139,9 @@ export async function scrapeCourseData() {
newButton.style.border = 'none';
newButton.style.borderRadius = '5px';
newButton.style.padding = '10px';
newButton.style.margin = '10px';
newButton.innerText = 'Save';
newButton.style.margin = '10px auto 10px auto';
newButton.style.display = 'block';
newButton.innerText = 'Add to Calendar';
// this is in case we have multiple instructions per section
const sectionProfessors = professor.split(',');
sectionProfessors.forEach((sectionProfessor) => {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ const Index = () => {
rmp={rmp}
setPage={setPageAndScroll}
/>
{(process.env.PLASMO_BROWSER === 'chrome' && !isSignedIn) && (
{process.env.PLASMO_BROWSER === 'chrome' && !isSignedIn && (
<Button
variant="contained"
disableElevation
Expand All @@ -353,8 +353,8 @@ const Index = () => {
>
Optional: Enable Google Calendar to add your classes with the
press of a button
</Button>)
}
</Button>
)}
</div>
{page !== 'list' && (
<div className="h-fit min-h-full p-4 dark:bg-black">
Expand Down

0 comments on commit d33165a

Please sign in to comment.