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

Change#309/mudanças em css #311

Merged
merged 6 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
Binary file added public/assets/imgs/group2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 28 additions & 9 deletions src/components/ProfileInfo/ProfileGroups/ProfileGroups.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,50 @@
height: fit-content;
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);

.header-container{
display: flex;
flex-direction: column;
align-items: center;
background-color: var(--primary-color);
max-height: 5rem;
justify-content: center;
margin-bottom: 1.5rem;
}

.group-background-image{
opacity: 30%;
max-width: 10rem;
max-height: 10rem;
align-self: flex-start;
margin-left: -2rem;
margin-top: 1rem;
}

.groups-name {
text-align: center;
padding: 1.15rem;
background-color: var(--primary-color);
color: white;
font-weight: var(--font-weight-bold);
font-style: normal;
margin-bottom: 20px;
font-size: 1.25rem;
position: absolute;
}

.items-wrapper {
margin: 0 auto;
width: 90%;
display: flex;
justify-content: center;

.show-items {
display: grid;
grid-template-columns: repeat(4, 1fr);
column-gap: 1em;
row-gap: 1em;
display: flex;
flex-wrap:wrap;
max-width: 80%;
column-gap: 1rem;
justify-content: space-evenly;

.group-item img {
border-radius: 5px;
border: solid 1px var(--primary-color);
width: 60px;
width: 4em;
aspect-ratio: 1;
display: flex;
align-items: center;
Expand Down
5 changes: 4 additions & 1 deletion src/components/ProfileInfo/ProfileGroups/ProfileGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export type ProfileGroupsProps = {
export function ProfileGroups(props: ProfileGroupsProps) {
return (
<div className="profile-groups-component">
<h1 className="groups-name">Meus grupos</h1>
<div className="header-container">
<img src="/assets/imgs/group2.png" className="group-background-image"></img>
<h1 className="groups-name">Meus grupos</h1>
</div>
<div className="items-wrapper">
{
props.groups.length <= 0
Expand Down
5 changes: 4 additions & 1 deletion src/components/UniversiForm/UniversiForm.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;

.image-preview {
height: 5rem;
Expand Down Expand Up @@ -53,9 +54,11 @@
background-color: white;
border-radius: var(--border-radius);

width: 45rem;
width: 80vw;
overflow: hidden;

max-height: 90vh;

box-sizing: 0px 4px 4px 0px rgba(0, 0, 0, 0.50);

@header-padding: 1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ img.logged-user-image {
cursor: pointer;
overflow: hidden;
margin-top: 3.5rem;
z-index: 9999;
margin-right: 2rem;
}

.submenu-item{
Expand Down
20 changes: 16 additions & 4 deletions src/pages/Group/GroupTabs/GroupFeed/GroupFeed.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,29 @@
display: flex;
flex-direction: row;
align-items: start;
flex-wrap: wrap;
justify-content: space-between;

height: fit-content;

width: 100%;

.feed-user-info{
text-decoration: none;
display: flex;
flex-direction: row;
align-items: center;
color: var(--font-color-v2);
gap: 1rem;
font-weight: bold;
}

&:not(:last-of-type) {
margin-bottom: 1.5rem;
}

.feed-image {
@side: 8rem !important;
@side: 3em !important;
width: @side;
height: @side;
aspect-ratio: 1;
Expand All @@ -28,23 +40,23 @@
}

.info {
margin-left: 3rem;

color: @font-color-v2;
display: flex;
flex-direction: row;
width: 100%;
justify-content: space-between;
margin-top: 1rem;
.group-name {
color: inherit;
text-decoration: none;
font-weight: @font-weight-semibold;
font-size: 1.5rem;
}

.group-description {
.feed-description {
margin-top: .75rem;
text-align: justify;
text-align: left;
}
}
.options-button {
Expand Down
17 changes: 10 additions & 7 deletions src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
const groupContext = useContext(GroupContext);

if(!groupContext)
return null;

Check warning on line 23 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L23

Added line #L23 was not covered by tests

const OPTIONS_DEFINITION: OptionInMenu<GroupPost>[] = [

Check warning on line 25 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L25

Added line #L25 was not covered by tests
{
text: "Editar publicação",
biIcon: "pencil-fill",
onSelect(data) {
groupContext.setEditPost(data);

Check warning on line 30 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L29-L30

Added lines #L29 - L30 were not covered by tests
},
hidden(){
return false;

Check warning on line 33 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L32-L33

Added lines #L32 - L33 were not covered by tests
},
},
{
Expand All @@ -38,30 +38,30 @@
biIcon: "trash-fill",
className: "delete",
onSelect: handleDeletePost,
hidden() {
return !groupContext?.group.canEdit;

Check warning on line 42 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L41-L42

Added lines #L41 - L42 were not covered by tests
},
}
]

function handleDeletePost(post: GroupPost){
console.log(post)
UniversimeApi.Feed.deleteGroupPost({postId: post.postId, groupId: post.groupId});
groupContext?.refreshData();

Check warning on line 50 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L47-L50

Added lines #L47 - L50 were not covered by tests
}

function canCreatePost(){

Check warning on line 53 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L53

Added line #L53 was not covered by tests
if(groupContext?.group.everyoneCanPost && groupContext.participants.some(p => p.id == groupContext.loggedData.profile.id))
return true;

Check warning on line 55 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L55

Added line #L55 was not covered by tests
else if(!groupContext?.group.everyoneCanPost && groupContext?.group.canEdit)
return true;
return false;

Check warning on line 58 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L57-L58

Added lines #L57 - L58 were not covered by tests
}

function canSeeMenu(post : GroupPost){

Check warning on line 61 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L61

Added line #L61 was not covered by tests
if(groupContext?.loggedData.profile.id != groupContext?.group.admin.id && groupContext?.loggedData.profile.id != post.author?.id)
return false;
return true;

Check warning on line 64 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L63-L64

Added lines #L63 - L64 were not covered by tests
}


Expand Down Expand Up @@ -131,17 +131,14 @@
<div className="feed-item tab-item">
{
author
?
<Link to={`/profile/${author?.user.name}`}>
?
<>

Check warning on line 135 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L135

Added line #L135 was not covered by tests
<Link to={`/profile/${author?.user.name}`} className="feed-user-info">
<img className="feed-image" src={author.imageUrl} />
<p>{post.author.firstname} {post.author.lastname}</p>
</Link>
: <></>
}

<div className="info">
<p className="group-description">{post.content}</p>
{ !hasAvailableOption(OPTIONS_DEFINITION) || !canSeeMenu(post) ? null :
<DropdownMenu.Root>

Check warning on line 141 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L141

Added line #L141 was not covered by tests
<DropdownMenu.Trigger asChild>
<button className="options-button">
<i className="bi bi-three-dots-vertical" />
Expand All @@ -149,19 +146,25 @@
</DropdownMenu.Trigger>

<DropdownMenu.Content className="options" side="left">
{ OPTIONS_DEFINITION.map(def => {

Check warning on line 149 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L149

Added line #L149 was not covered by tests
if(def.text == "Editar publicação" && post.author?.id == groupContext?.loggedData.profile.id)
return renderOption(post, def)

Check warning on line 151 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L151

Added line #L151 was not covered by tests
else if(def.text == "Editar publicação")
return null

Check warning on line 153 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L153

Added line #L153 was not covered by tests
else
return renderOption(post, def)

Check warning on line 155 in src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx

View check run for this annotation

Codecov / codecov/patch

src/pages/Group/GroupTabs/GroupFeed/GroupFeed.tsx#L155

Added line #L155 was not covered by tests

}) }
<DropdownMenu.Arrow className="options-arrow" height=".5rem" width="1rem" />
</DropdownMenu.Content>
</DropdownMenu.Root>
}
</>
: <></>
}

<div className="info">
<p className="feed-description">{post.content}</p>
</div>
</div>
)
Expand Down
12 changes: 6 additions & 6 deletions src/pages/Group/GroupTabs/GroupPeople/GroupPeople.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
@import url(/src/layouts/fonts.less);

#group-page #people .people-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
display: flex;
flex-direction: row;
flex-wrap: wrap;
row-gap: 1.5rem;
row-gap: 1rem;
column-gap: .5rem;
column-gap: 1.5rem;
justify-content: center;

.person-item {
display: flex;
flex-direction: row;
align-items: start;

width: 95%;
width: 25rem;

text-align: center;

Expand Down
3 changes: 3 additions & 0 deletions src/pages/Group/GroupTabs/GroupTabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
display: flex;
gap: 1rem;

flex-wrap: wrap;
justify-content: right;

}
}

Expand Down
3 changes: 2 additions & 1 deletion src/pages/ManageProfile/ManageProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export function ManageProfilePage() {
}
}

const { value: password, isConfirmed } = await SwalUtils.fireModal({
let hasPassword = authContext.user?.hasPassword ?? false;
const { value: password, isConfirmed } = !hasPassword ? {value: null, isConfirmed: true} : await SwalUtils.fireModal({
title: "Edição de perfil",
input: "password",
inputLabel: "Inserir senha para salvar as alterações",
Expand Down
20 changes: 10 additions & 10 deletions src/pages/singin/Singin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ export default function Singin() {

return (
<div>
<footer className="waves-footer">
<div className="waves">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
<path
fill-opacity="1"
d="M0,160L60,133.3C120,107,240,53,360,74.7C480,96,600,192,720,245.3C840,299,960,309,1080,309.3C1200,309,1320,299,1380,293.3L1440,288L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z"
></path>
</svg>
</div>
</footer>
<div className="signin-container">
<div className="logo">
{/* <UniversiLogo /> */}
Expand All @@ -22,16 +32,6 @@ export default function Singin() {
<div className="signin">
<SinginForm></SinginForm>
</div>
<footer className="waves-footer">
<div className="waves">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
<path
fill-opacity="1"
d="M0,160L60,133.3C120,107,240,53,360,74.7C480,96,600,192,720,245.3C840,299,960,309,1080,309.3C1200,309,1320,299,1380,293.3L1440,288L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z"
></path>
</svg>
</div>
</footer>
</div>
</div>
);
Expand Down
17 changes: 14 additions & 3 deletions src/pages/singin/signin.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
justify-content: center;
align-items: center;
flex-wrap: wrap;
margin-top: 10rem;
gap: 5rem;

position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);


flex-direction: row;
width: 100%;
}

.logo {
Expand All @@ -16,7 +24,6 @@
letter-spacing: 2px;
gap: 2px;

margin-right: 3rem;
}

.logo img {
Expand All @@ -30,11 +37,15 @@
text-align: 10px;
color: var(--font-color-v2);

margin-left: 2rem;

margin-top: 1em;
}

footer {
width: 100vw;
position: fixed;
top: 100%;
}

.waves svg {
Expand All @@ -49,4 +60,4 @@ footer {
position: relative;
margin-bottom: -10px;
}
}
}
2 changes: 0 additions & 2 deletions src/pages/singin/signinForm.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.container {
width: fit-content;
height: fit-content;
background-color: white;
display: flex;
align-items: center;
Expand Down
1 change: 1 addition & 0 deletions src/types/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type User = {
ownerOfSession: boolean;
needProfile: boolean;
accessLevel?: UserAccessLevel;
hasPassword?: boolean;
}

export const UserAccessLevelLabel: { [k in UserAccessLevel]: string } = {
Expand Down
Loading