Improved navigation from meet to account + UI for account dev

This commit is contained in:
Bofh 2021-01-01 02:12:44 +01:00
parent 4a224ff6c1
commit 8fd7855600
5 changed files with 52 additions and 15 deletions

View File

@ -24,7 +24,7 @@
<span id="acct">-</span>
</div>
<div id="back">
<a href="/direct">
<a href="javascript:window.history.back()">
<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 0 24 24" width="40">
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"/>

View File

@ -1,9 +1,6 @@
{#if $isUserLoggedIn}
<TimelinePage {timeline} >
<DynamicPageBanner title="" {ariaTitle} />
{#if !filter}
<PinnedStatuses {accountId} />
{/if}
</TimelinePage>
{:else}
<HiddenFromSSR>
@ -21,8 +18,6 @@
import HiddenFromSSR from '../HiddenFromSSR'
import DynamicPageBanner from '../DynamicPageBanner.html'
import { updateProfileAndRelationship, clearProfileAndRelationship } from '../../_actions/accounts'
import AccountProfile from './AccountProfile.html'
import PinnedStatuses from '../timeline/PinnedStatuses.html'
import { formatIntl } from '../../_utils/formatIntl'
export default {
@ -53,9 +48,7 @@
TimelinePage,
FreeTextLayout,
HiddenFromSSR,
DynamicPageBanner,
AccountProfile,
PinnedStatuses
DynamicPageBanner
}
}
</script>

View File

@ -19,7 +19,7 @@
</div>
<div class="meet-footer">
<StatusAuthorName {...params} />
<!-- <StatusAuthorHandle {...params} />-->
<StatusAuthorHandle {...params} />
<StatusRelativeDate {...params} {...timestampParams} />
{#if showCard }
<StatusCard {...params} />

View File

@ -254,6 +254,38 @@ div.main-content.chat, div.main-content.meet, div.main-content.account {
div.main-content.account {
padding-top: 0 !important;
main {
width: initial !important;
}
div.virtual-list {
max-width: 100em;
margin: auto;
article.status-article {
background: none !important;
padding: 0;
div.status-media {
height: 100vh;
margin: 0;
button.inline-media {
cursor: initial !important;
overflow: visible;
pointer-events: none;
}
}
a.status-author-name, span.status-author-handle, a.status-relative-date,
div.status-content, div.status-toolbar, div.like-div, a.status-sidebar {
display: none;
}
}
}
}
div.main-content.meet {
@ -268,6 +300,8 @@ div.main-content.meet {
}
div.virtual-list-item {
max-width: 100em;
margin: auto;
article.status-article {
background-repeat: no-repeat !important;

View File

@ -66,7 +66,7 @@ var fediloveUI = {
if (!isRightSwipe && elements.length > 0) {
const accId = elements.first().data('account');
elements.first()[0].style.animation = 'dismissMeet .25s linear 1';
setTimeout(function() { elements.first().find('a.status-sidebar > img').click() }, 200);
setTimeout(function() { fediloveApi.redirect(`/accounts/${accId}`) }, 200);
}
},
scrollChatToLastItem: function() {
@ -112,6 +112,14 @@ var fediloveUI = {
// objects to access from React code
var fediloveApi = {
redirect: function(url) {
const _id = 'link-' + Date.now();
var a = document.createElement('a');
a.href = url; a.id = _id;
document.body.append(a);
document.getElementById(_id).click();
document.body.removeChild(a);
},
getChatMessageId: function() {
var parts = window.location.pathname.split('/');
return parts[parts.length-1];
@ -396,12 +404,14 @@ function fedilove_customization() {
// we inject this script.js into the React framework at timelines.js
// Watch for URL changes every 1/2 seconds (this is efficient, don't worry about it!)
// and dispatch a call to "fedilove_customization" to load page customizations depending on URL context
var theurl = null;
var __window_url = null;
var __window_url_old = null;
setInterval(function() {
var newurl = window.location.pathname;
if (newurl != theurl) {
const newurl = window.location.pathname;
if (newurl != __window_url) {
__window_url_old = __window_url;
__window_url = newurl;
fedilove_customization();
theurl = newurl;
}
}, 250);