Skip to content

Commit

Permalink
Admin Only: Add moderation button to explore pane server item
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Dec 13, 2024
1 parent 145fc9b commit dd71b53
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/components/explore/ExploreServers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ const ButtonsContainer = styled(FlexRow)`
margin-top: auto;
padding-top: 10px;
padding-bottom: 4px;
margin-left: auto;
margin-right: 4px;
margin-right: 8px;
justify-content: end;
flex-shrink: 0;
`;

Expand All @@ -302,6 +302,7 @@ function PublicServerItem(props: {
const server = props.publicServer.server!;
const [joinClicked, setJoinClicked] = createSignal(false);
const [hovered, setHovered] = createSignal(false);
const store = useStore();
const navigate = useNavigate();

const { createPortal } = useCustomPortal();
Expand Down Expand Up @@ -416,11 +417,12 @@ function PublicServerItem(props: {
<Text class={descriptionStyles} size={12} opacity={0.6}>
{props.publicServer.description}
</Text>
<ButtonsContainer>
<ButtonsContainer gap={4}>
<Button
padding={8}
iconSize={18}
onClick={bumpClick}
margin={0}
iconName="arrow_upward"
label={t("explore.servers.bumpButton", {
count: props.publicServer.bumpCount.toLocaleString(),
Expand All @@ -436,6 +438,7 @@ function PublicServerItem(props: {
>
<Button
padding={8}
margin={0}
iconSize={18}
iconName="login"
label={t("explore.servers.visitServerButton")}
Expand All @@ -444,13 +447,23 @@ function PublicServerItem(props: {
</Show>
<Show when={!cacheServer()}>
<Button
margin={0}
padding={8}
iconSize={18}
onClick={joinServerClick}
iconName="login"
label={t("explore.servers.joinServerButton")}
/>
</Show>
<Show when={store.account.hasModeratorPerm()}>
<Button
margin={0}
padding={8}
iconSize={18}
href={`/app/moderation/servers/${props.publicServer.serverId}`}
iconName="security"
/>
</Show>
</ButtonsContainer>
<FlexRow
style={{
Expand Down

0 comments on commit dd71b53

Please sign in to comment.