mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 09:06:23 +01:00
Fix updates button got cut off in larger viewport
This commit is contained in:
parent
6fcf844893
commit
d2d8571b3f
3 changed files with 49 additions and 48 deletions
|
@ -430,15 +430,17 @@ a.mention span {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
transform: translate(-50%, 150%);
|
transform: translate(-50%, 0);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.updates-button {
|
.updates-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
animation: fade-from-top 2s ease-out;
|
animation: fade-from-top 2s ease-out;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, 150%);
|
margin-top: 8px;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
to bottom,
|
to bottom,
|
||||||
|
|
|
@ -199,28 +199,28 @@ function Home({ hidden }) {
|
||||||
<Icon icon="notification" size="l" alt="Notifications" />
|
<Icon icon="notification" size="l" alt="Notifications" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{snapStates.homeNew.length > 0 && (
|
|
||||||
<button
|
|
||||||
class="updates-button"
|
|
||||||
type="button"
|
|
||||||
onClick={() => {
|
|
||||||
const uniqueHomeNew = snapStates.homeNew.filter(
|
|
||||||
(status) => !states.home.some((s) => s.id === status.id),
|
|
||||||
);
|
|
||||||
states.home.unshift(...uniqueHomeNew);
|
|
||||||
loadStatuses(true);
|
|
||||||
states.homeNew = [];
|
|
||||||
|
|
||||||
scrollableRef.current?.scrollTo({
|
|
||||||
top: 0,
|
|
||||||
behavior: 'smooth',
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Icon icon="arrow-up" /> New posts
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</header>
|
</header>
|
||||||
|
{snapStates.homeNew.length > 0 && (
|
||||||
|
<button
|
||||||
|
class="updates-button"
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
const uniqueHomeNew = snapStates.homeNew.filter(
|
||||||
|
(status) => !states.home.some((s) => s.id === status.id),
|
||||||
|
);
|
||||||
|
states.home.unshift(...uniqueHomeNew);
|
||||||
|
loadStatuses(true);
|
||||||
|
states.homeNew = [];
|
||||||
|
|
||||||
|
scrollableRef.current?.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon="arrow-up" /> New posts
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
{snapStates.home.length ? (
|
{snapStates.home.length ? (
|
||||||
<>
|
<>
|
||||||
<ul class="timeline">
|
<ul class="timeline">
|
||||||
|
|
|
@ -311,32 +311,31 @@ function Notifications() {
|
||||||
<div class="header-side">
|
<div class="header-side">
|
||||||
<Loader hidden={uiState !== 'loading'} />
|
<Loader hidden={uiState !== 'loading'} />
|
||||||
</div>
|
</div>
|
||||||
{snapStates.notificationsNew.length > 0 && (
|
|
||||||
<button
|
|
||||||
class="updates-button"
|
|
||||||
type="button"
|
|
||||||
onClick={() => {
|
|
||||||
const uniqueNotificationsNew =
|
|
||||||
snapStates.notificationsNew.filter(
|
|
||||||
(notification) =>
|
|
||||||
!snapStates.notifications.some(
|
|
||||||
(n) => n.id === notification.id,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
states.notifications.unshift(...uniqueNotificationsNew);
|
|
||||||
loadNotifications(true);
|
|
||||||
states.notificationsNew = [];
|
|
||||||
|
|
||||||
scrollableRef.current?.scrollTo({
|
|
||||||
top: 0,
|
|
||||||
behavior: 'smooth',
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Icon icon="arrow-up" /> New notifications
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</header>
|
</header>
|
||||||
|
{snapStates.notificationsNew.length > 0 && (
|
||||||
|
<button
|
||||||
|
class="updates-button"
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
const uniqueNotificationsNew = snapStates.notificationsNew.filter(
|
||||||
|
(notification) =>
|
||||||
|
!snapStates.notifications.some(
|
||||||
|
(n) => n.id === notification.id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
states.notifications.unshift(...uniqueNotificationsNew);
|
||||||
|
loadNotifications(true);
|
||||||
|
states.notificationsNew = [];
|
||||||
|
|
||||||
|
scrollableRef.current?.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon="arrow-up" /> New notifications
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<div id="mentions-option">
|
<div id="mentions-option">
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
|
|
Loading…
Reference in a new issue