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

do not merge me #261

Closed
wants to merge 18 commits into from
Closed
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
4 changes: 2 additions & 2 deletions components/app/interface/settings/_layout/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ const CloseAnchor = styled.a`
transition: ${(props) => props.theme!.transitions.fast} background-color;

svg {
transition: ${(props) => props.theme!.transitions.fast} background-color;
color: ${(props) =>
props.theme!.colours["settings-close-anchor"]} !important;
transition: ${(props) => props.theme!.transitions.fast} background-color;
}

&:hover {
Expand Down Expand Up @@ -151,7 +151,7 @@ const CloseAction = styled.div`
justify-content: center;
width: 36px;
font-weight: 600;
color: ${(props) => props.theme!.colours["settings-content-foreground"]};
font-size: 0.75rem;
color: ${(props) => props.theme!.colours["settings-foreground"]};
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const SidebarButton = styled.a<Props>`
font-size: 15px;
user-select: none;
transition: background-color 0.1s ease-in-out;
fill: ${(props) => props.theme!.colours["settings-sidebar-foreground"]};
color: ${(props) => props.theme!.colours["settings-sidebar-foreground"]};

svg {
Expand Down
7 changes: 4 additions & 3 deletions components/app/interface/settings/client/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function UserInformation() {
</div>
</div>
</ProfileDetails>
<div class="button">
{/*<div class="button">
<MdEdit {...iconSize(22)} />
</div>
</div>*/}
</div>
<BadgeContainer>
<ProfileBadges>
Expand Down Expand Up @@ -119,6 +119,7 @@ const ProfileBadges = styled.div`
display: flex;

background: ${(props) => props.theme!.colours["settings-background"]};
fill: ${(props) => props.theme!.colours["settings-foreground"]};
`;

/**
Expand All @@ -133,7 +134,7 @@ const AccountBox = styled(Row)`
rgba(255, 255, 255, 0.7)
),
url("https://autumn.revolt.chat/backgrounds/PA-U1R3u-iw72V-WH0C9aDN1rBTbnm-sKNR8YN4RL8?width=1000");
color: ${(props) => props.theme!.colours["foreground"]};
color: black;

.column {
display: flex;
Expand Down
12 changes: 6 additions & 6 deletions components/app/interface/settings/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ const Config: SettingsConfiguration<{ server: Server }> = {
title: <></>,
hidden: true,
},
{
/*{
id: "profile",
icon: <MdAccountCircle {...iconSize(20)} />,
title: t("app.settings.pages.profile.title"),
},
},*/
{
id: "sessions",
icon: <MdVerifiedUser {...iconSize(20)} />,
Expand Down Expand Up @@ -154,7 +154,7 @@ const Config: SettingsConfiguration<{ server: Server }> = {
},
],
},
{
/*{
title: t("app.settings.categories.client_settings"),
entries: [
{
Expand Down Expand Up @@ -212,15 +212,15 @@ const Config: SettingsConfiguration<{ server: Server }> = {
title: t("app.settings.pages.experiments.title"),
},
],
},
},*/
{
entries: [
{
/*{
onClick: () =>
getController("modal").push({ type: "changelog", posts: [] }),
icon: <MdFormatListBulleted {...iconSize(20)} />,
title: t("app.special.modals.changelogs.title"),
},
},*/
{
href: "https://github.com/revoltchat",
icon: <MdMemory {...iconSize(20)} />,
Expand Down
16 changes: 16 additions & 0 deletions components/app/menus/ChannelContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getController } from "@revolt/common";
import MdBadge from "@material-design-icons/svg/outlined/badge.svg?component-solid";
import MdDelete from "@material-design-icons/svg/outlined/delete.svg?component-solid";
import MdLibraryAdd from "@material-design-icons/svg/outlined/library_add.svg?component-solid";
import MdMarkChatRead from "@material-design-icons/svg/outlined/mark_chat_read.svg?component-solid";
import MdShield from "@material-design-icons/svg/outlined/shield.svg?component-solid";

import {
Expand All @@ -21,6 +22,13 @@ import {
* @returns
*/
export function ChannelContextMenu(props: { channel: Channel }) {
/**
* Mark server as read
*/
function markAsRead() {
props.channel.ack();
}

/**
* Create a new channel
*/
Expand Down Expand Up @@ -60,6 +68,13 @@ export function ChannelContextMenu(props: { channel: Channel }) {

return (
<ContextMenu>
<Show when={props.channel.unread}>
<ContextMenuButton icon={MdMarkChatRead} onClick={markAsRead}>
Mark as read
</ContextMenuButton>
<ContextMenuDivider />
</Show>

<Show when={props.channel.server?.havePermission("ManageChannel")}>
{/* TODO re order */}
<ContextMenuButton icon={MdLibraryAdd} onClick={createChannel}>
Expand All @@ -72,6 +87,7 @@ export function ChannelContextMenu(props: { channel: Channel }) {
</ContextMenuButton>
<ContextMenuDivider />
</Show>

<ContextMenuButton icon={MdShield} onClick={openAdminPanel}>
Admin Panel
</ContextMenuButton>
Expand Down
1 change: 1 addition & 0 deletions components/app/menus/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const ContextMenu = styled.div`
props.theme!.colours["component-context-menu-background"]};
color: ${(props) =>
props.theme!.colours["component-context-menu-foreground"]};
fill: ${(props) => props.theme!.colours["component-context-menu-foreground"]};

box-shadow: 0 0 3px
${(props) => props.theme!.colours["component-context-menu-shadow"]};
Expand Down
2 changes: 1 addition & 1 deletion components/app/menus/MessageContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function MessageContextMenu(props: { message: Message }) {
* Mark message as unread
*/
function markAsUnread() {
props.message.ack();
props.message.channel!.ack(props.message, false, false, true);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions components/auth/src/flows/FlowHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ const AccountSwitcher = styled(Column)`

const Logo = styled(RevoltSvg)`
margin: auto;
fill: ${(props) => props.theme!.colours.foreground};
/* filter: invert(1); */
filter: ${(props) => props.theme!.effects.svg.light};
`;

/**
Expand Down
4 changes: 3 additions & 1 deletion components/client/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export default class ClientController {
*/
createClient(session: PrivateSession) {
if (typeof session === "string") throw "Bot login not supported";
if (this.#clients.get(session.user_id)) throw "User client already exists";
// if (this.#clients.get(session.user_id)) throw "User client already exists";
this.#clients.delete(session.user_id);
// TODO: yeah whatever

const client = new Client({
baseURL: CONFIGURATION.DEFAULT_API_URL,
Expand Down
26 changes: 26 additions & 0 deletions components/modal/modals/DemoJoinLounge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useTranslation } from "@revolt/i18n";

import { createFormModal } from "../form";
import { PropGenerator } from "../types";

const DemoJoinLounge: PropGenerator<"demo"> = (props) => {
const t = useTranslation();

return createFormModal({
modalProps: {
title: "You are about to join the Revolt server",
description:
"Here you will be able to test the client and give feedback.",
},
schema: {},
data: {},
callback: async () => {
await props.client.api.post(`/invites/Testers`);
},
submit: {
children: t("app.special.modals.actions.ok"),
},
});
};

export default DemoJoinLounge;
2 changes: 2 additions & 0 deletions components/modal/modals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import delete_bot from "./DeleteBot";
import delete_channel from "./DeleteChannel";
import delete_message from "./DeleteMessage";
import delete_server from "./DeleteServer";
import demo from "./DemoJoinLounge";
import edit_email from "./EditEmail";
import edit_keybind from "./EditKeybind";
import edit_password from "./EditPassword";
Expand All @@ -44,6 +45,7 @@ import sign_out_sessions from "./SignOutSessions";
import signed_out from "./SignedOut";

const Modals: Record<AllModals["type"], PropGenerator<any>> = {
demo,
add_friend,
ban_member,
changelog,
Expand Down
1 change: 1 addition & 0 deletions components/modal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ChangelogPost } from "./modals/Changelog";
export type Modals =
| {
type:
| "demo"
| "add_friend"
| "create_group"
| "create_or_join_server"
Expand Down
10 changes: 2 additions & 8 deletions components/ui/components/design/atoms/display/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ export const HeaderWithImage = styled(Header)`
> * {
flex-grow: 1;
padding: 6px 14px;
color: ${(props) =>
props.theme!.colours["sidebar-header-with-image-text-foreground"]};
background: linear-gradient(
0deg,
${(props) =>
props.theme!.colours["sidebar-header-with-image-text-background"]},
transparent
);
color: white;
background: linear-gradient(0deg, black, transparent);
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ const IconWrapper = styled.div`
svg {
color: ${(props) =>
props.theme!.colours["component-categorybtn-foreground-description"]};
fill: ${(props) =>
props.theme!.colours["component-categorybtn-foreground-description"]};
}
`;

Expand Down
9 changes: 9 additions & 0 deletions components/ui/components/design/atoms/inputs/MenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ const Base = styled(Row)<Pick<Props, "size" | "attention">>`

${(props) => generateTypographyCSS(props.theme!, "menu-button")};

fill: ${(props) =>
props.theme!.colours[
props.attention === "active" || props.attention === "selected"
? "component-menubtn-selected-foreground"
: props.attention === "muted"
? "component-menubtn-muted-foreground"
: "component-menubtn-default-foreground"
]};

color: ${(props) =>
props.theme!.colours[
props.attention === "active" || props.attention === "selected"
Expand Down
27 changes: 16 additions & 11 deletions components/ui/components/navigation/channels/ServerSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,18 @@ export const ServerSidebar = (props: Props) => {
<List gap="lg">
<div />
<For each={props.server.orderedChannels}>
{(category) => (
<Category
category={category}
channelId={props.channelId}
menuGenerator={props.menuGenerator}
/>
)}
{(category) =>
![
"01G3E05H65N1K6WM64SPVJ4PSE",
"01HC0JQH88WC02Y0S1VE9WEBRM",
].includes(category.id) && (
<Category
category={category}
channelId={props.channelId}
menuGenerator={props.menuGenerator}
/>
)
}
</For>
<div />
</List>
Expand All @@ -204,9 +209,9 @@ function ServerInfo(
<TextWithEmoji content={props.server.name} />
</OverflowingText>
</ServerName>
<SettingsLink onClick={props.openServerSettings}>
{/* <SettingsLink onClick={props.openServerSettings}>
<BiSolidCog size={18} />
</SettingsLink>
</SettingsLink> */}
</Row>
);
}
Expand Down Expand Up @@ -381,7 +386,7 @@ function Entry(
<MdPersonAdd {...iconSize("14px")} />
</a>

<a
{/* <a
use:floating={{
tooltip: {
placement: "top",
Expand All @@ -398,7 +403,7 @@ function Entry(
}}
>
<MdSettings {...iconSize("14px")} />
</a>
</a> */}
</>
}
>
Expand Down
Loading
Loading