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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Friends): combine friends routes #801

Merged
merged 1 commit into from
Dec 27, 2021
Merged
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
2 changes: 1 addition & 1 deletion assets/styles/platforms/iOS.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@supports (-webkit-touch-callout: none) {
html {
min-height: calc(@full + env(safe-area-inset-top) - 11px);
min-height: calc(@full + env(safe-area-inset-top));
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#app {
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/themes/moonless_night.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.moonless_night {
//------------- Colors -------------
@white: #fff;
@flair: #2ed573;
@flair: #B53471;

@background: #15161d;
@midground: #000;
Expand Down
1 change: 1 addition & 0 deletions components/views/friends/add/Add.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
margin: 0 @normal-spacing;
}
padding: @normal-spacing;
padding-top: 0;
}

@media only screen and (max-width: @mobile-breakpoint) {
Expand Down
12 changes: 6 additions & 6 deletions mock/friends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ export const Requests = [
]

export const Blocked = [
// {
// name: 'Toxic McToxicson',
// address: '0xdfeeb223bafbe5c5271415c75aecd68c21fe3d7f',
// status: 'Reeeeeeeee',
// state: 'online',
// },
{
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note here, if we want to not use mock content we should add a real placeholder in state, this way mock data can still be used in tests, instead of being commented out.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why I've uncommented.

name: 'Toxic McToxicson',
address: '0xdfeeb223bafbe5c5271415c75aecd68c21fe3d7f',
status: 'Reeeeeeeee',
state: 'online',
},
]

export const Friend = {
Expand Down
88 changes: 48 additions & 40 deletions pages/friends/list/FriendsList.html
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
<div id="friends-list" v-scroll-lock="true" class="hidden-scroll">
<UiScroll verticalScroll enableWrap scrollbarVisibility="scroll">
<FriendsNav :setRoute="setRoute" :route="route" />
<div v-if="$data.route === 'active'">
<div v-if="dataState.friends !== DataStateType.Loading">
<div v-for="entry in Object.entries(alphaSortedFriends)">
<span class="alpha-divider">{{entry[0].toUpperCase()}}</span>
<div v-for="friend in entry[1]">
<FriendsFriend :friend="friend" :key="friend.address" />
<!--<FriendsNav :setRoute="setRoute" :route="route" />-->
<div class="columns">
<div class="column is-half-desktop">
<!-- Friends Add -->
<FriendsAdd />
<!-- Friend Requests -->
<div v-if="friends.incomingRequests.length" class="padded_divider">
<TypographyHorizontalRuleText plaintext :value="$t('friends.requests')" />
</div>
<FriendsFriend
v-for="friend in friends.incomingRequests"
:friend="{
name: friend.userInfo.name,
address: friend.from,
state: 'offline',
status: friend.userInfo.status,
request: friend
}"
:key="friend.from"
request
/>
</div>
<div class="column is-half-desktop">
<!-- Friends List -->
<div v-if="Object.entries(alphaSortedFriends).length && $device.isMobile" class="padded_divider">
<TypographyHorizontalRuleText plaintext :value="$t('friends.all')" />
</div>
<div v-if="dataState.friends !== DataStateType.Loading">
<div v-for="entry in Object.entries(alphaSortedFriends)">
<span class="alpha-divider">{{entry[0].toUpperCase()}}</span>
<FriendsFriend v-for="friend in entry[1]" :friend="friend" :key="friend.address" />
</div>
<div
class="loading-container"
v-if="dataState.friends === DataStateType.Updating"
>
<UiLoadersUpdating />
</div>
</div>
<div
class="loading-container"
v-if="dataState.friends === DataStateType.Updating"
>
<UiLoadersUpdating />
<div v-else>
<UiLoadersFriend :count="5" />
</div>
<div v-if="Object.entries($mock.blocked).length" class="padded_divider">
<TypographyHorizontalRuleText plaintext :value="$t('friends.blocked')" />
</div>
<FriendsFriend
v-for="friend in $mock.blocked"
:friend="friend"
:key="friend.address"
blocked
/>
</div>
<div v-else>
<UiLoadersFriend :count="5" />
</div>
</div>
<div v-if="$data.route === 'requests'">
<FriendsFriend
v-for="friend in friends.incomingRequests"
:friend="{
name: friend.userInfo.name,
address: friend.from,
state: 'offline',
status: friend.userInfo.status,
request: friend
}"
:key="friend.from"
request
/>
</div>
<div v-if="$data.route === 'blocked'">
<FriendsFriend
v-for="friend in $mock.blocked"
:friend="friend"
:key="friend.address"
blocked
/>
</div>
<div v-if="$data.route === 'add'">
<FriendsAdd />
</div>
</UiScroll>
</div>
10 changes: 8 additions & 2 deletions pages/friends/list/FriendsList.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
font-family: @primary-font;
}

#chat {
&:extend(.light-padding);}

#friends {
padding: @normal-spacing 0 0 0;
}

.scrolling {
height: @full;
Expand All @@ -17,3 +19,7 @@
.loading-container {
text-align: center;
}

.padded_divider {
padding: @light-spacing @normal-spacing;
}