Skip to content

Commit

Permalink
improved post item style
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Nov 17, 2024
1 parent fc6738b commit daaf85d
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 26 deletions.
22 changes: 17 additions & 5 deletions src/components/DashboardPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,32 @@ function PostsContainer() {
});

return (
<FlexColumn>
<Text
<FlexColumn
class={css`
background-color: rgba(255, 255, 255, 0.07);
border-radius: 8px;
margin-left: 6px;
margin-right: 6px;
`}
>
{/* <Text
size={18}
style={{
"margin-left": "5px",
"margin-bottom": "5px",
"margin-top": "20px",
"margin-top": "4px",
}}
>
{t("dashboard.posts")}
</Text>
</Text> */}
<FlexRow
gap={5}
style={{ "margin-bottom": "5px", "margin-left": "5px", height: "28px" }}
style={{
"margin-bottom": "5px",
"margin-left": "5px",
height: "28px",
"margin-top": "6px",
}}
>
<ItemContainer
class={TabStyle}
Expand Down
25 changes: 20 additions & 5 deletions src/components/PostsArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,12 @@ const PostOuterContainer = styled(FlexColumn)`
scroll-margin-top: 50px;
padding: 10px;
border-radius: 8px;
border-bottom: solid 1px rgba(255, 255, 255, 0.2);
&:first-child {
border-top: solid 1px rgba(255, 255, 255, 0.2);
}
background: rgba(255, 255, 255, 0.06);
&:hover {
background: rgba(255, 255, 255, 0.07);
}
Expand Down Expand Up @@ -638,7 +641,7 @@ export function PostsArea(props: {
]}
/>
</Show>
<FlexColumn gap={2} ref={postsContainerRef}>
<FlexColumn ref={postsContainerRef}>
<For each={cachedReplies()}>
{(post, i) => (
<PostItem
Expand All @@ -653,6 +656,12 @@ export function PostsArea(props: {
<For each={Array(10).fill(0)}>
{() => (
<Skeleton.Item
class={css`
&& {
border-radius: 0;
border-top: solid 1px rgba(255, 255, 255, 0.2);
}
`}
onInView={() => loadMore()}
height="100px"
width="100%"
Expand Down Expand Up @@ -735,6 +744,12 @@ function PostNotification(props: { notification: RawPostNotification }) {
background: none;
}
box-shadow: none;
&::before {
border: none;
}
&:first-child {
border: none;
}
}
`}
/>
Expand Down Expand Up @@ -894,7 +909,7 @@ export function PostNotificationsArea(props: { style?: JSX.CSSProperties }) {
setNotifications(fetchNotifications);
});
return (
<PostsContainer gap={6} style={props.style}>
<PostsContainer style={props.style}>
<For each={notifications()}>
{(notification) => <PostNotification notification={notification} />}
</For>
Expand Down Expand Up @@ -961,7 +976,7 @@ export function ViewPostModal(props: { close(): void }) {
</MetaTitle>
<FlexColumn style={{ overflow: "auto", height: "100%" }}>
<Show when={post()}>
<FlexColumn gap={6}>
<FlexColumn>
<For each={commentToList()}>
{(post) => <PostItem showFullDate post={post!} />}
</For>
Expand Down
3 changes: 3 additions & 0 deletions src/components/floating-profile/FloatingProfile.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ body .postItemContainer {
border-radius: 6px;
background-color: rgba(255, 255, 255, 0.05);
box-shadow: none;
&::before {
border: none;
}
}

.roleContainer {
Expand Down
25 changes: 21 additions & 4 deletions src/components/post-area/PostItem.module.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
.postContainer {
position: relative;
display: flex;
flex-direction: column;
padding: 10px;
border-radius: 8px;

background: rgba(255, 255, 255, 0.06);

cursor: pointer;
gap: 10px;
scroll-margin-top: 50px;
&:hover {
background: rgba(255, 255, 255, 0.07);
background: rgba(255, 255, 255, 0.04);
}

&:before {
position: absolute;
right: 0;
bottom: 0;
left: 0;
border-bottom: solid 1px rgba(255, 255, 255, 0.2);
content: "";
}
&:first-child {
border-top: solid 1px rgba(255, 255, 255, 0.2);
}


&.disableClick {
cursor: initial;
}




}

.postInnerContainer {
Expand Down
12 changes: 0 additions & 12 deletions src/components/profile-pane/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,6 @@

white-space: nowrap;

:global .postItem {
position: relative;
background: transparent;
&:before {
position: absolute;
right: 0;
bottom: 0;
left: 0;
border-bottom: solid 1px rgba(255, 255, 255, 0.2);
content: "";
}
}
}

.SidePaneItem {
Expand Down

0 comments on commit daaf85d

Please sign in to comment.