Skip to content

Commit

Permalink
Add log in button
Browse files Browse the repository at this point in the history
  • Loading branch information
OctoNezd committed Jul 2, 2023
1 parent 792a673 commit 9808965
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion css/redditChanges.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
width: calc(100% - 10px - 10px);
}
.desktop-onboarding__col_sign-up_form {
width: 100vw;
width: 100%;
}
.pagename {
font-variant: normal !important;
Expand All @@ -97,3 +97,6 @@
.md blockquote {
color: var(--md-sys-color-on-surface-variant) !important;
}
.desktop-onboarding__col_sign-up_image {
display: none;
}
15 changes: 15 additions & 0 deletions js/user_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ async function setupSubreddits(actualSidebar) {
function moveHeaderItems(actualSidebar) {
const rheader = document.getElementById("header-bottom-right");
const userlink = rheader.querySelector(".user a");
if (userlink.innerText.includes("Log in")) {
const loginitem = createSidebarItem(
"Log in",
"javascript:void(0)",
"login",
false
);
loginitem.addEventListener("click", () => {
const rheader = document.getElementById("header-bottom-right");
const userlink = rheader.querySelector(".user a");
userlink.click();
});
actualSidebar.appendChild(loginitem);
return;
}
actualSidebar.appendChild(
createSidebarItem(
userlink.text,
Expand Down

0 comments on commit 9808965

Please sign in to comment.