SHA256
Remove bottom CTA from channel list
This commit is contained in:
@@ -1250,14 +1250,6 @@ function renderListContent({ screen, container, listState, navigate, refreshFeed
|
|||||||
container.append(list);
|
container.append(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateBottomCta({ button }) {
|
|
||||||
if (!button) return;
|
|
||||||
button.hidden = true;
|
|
||||||
button.textContent = '';
|
|
||||||
button.className = 'channels-bottom-action';
|
|
||||||
button.onclick = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadFeedAndRender({ screen, listState, contentEl, navigate }) {
|
async function loadFeedAndRender({ screen, listState, contentEl, navigate }) {
|
||||||
closeChannelMenu(listState);
|
closeChannelMenu(listState);
|
||||||
renderSkeletonList(contentEl, 5);
|
renderSkeletonList(contentEl, 5);
|
||||||
@@ -1403,9 +1395,6 @@ export function render({ navigate, route, chrome }) {
|
|||||||
topBarRight.append(findChannelBtn, createInMyBtn, topMenuBtn);
|
topBarRight.append(findChannelBtn, createInMyBtn, topMenuBtn);
|
||||||
topBarEl.append(topBarLeft, topBarRight);
|
topBarEl.append(topBarLeft, topBarRight);
|
||||||
|
|
||||||
const bottomCta = document.createElement('button');
|
|
||||||
bottomCta.type = 'button';
|
|
||||||
|
|
||||||
const reloadFeed = async () => loadFeedAndRender({ screen, listState, contentEl, navigate });
|
const reloadFeed = async () => loadFeedAndRender({ screen, listState, contentEl, navigate });
|
||||||
|
|
||||||
const rerenderList = () => {
|
const rerenderList = () => {
|
||||||
@@ -1426,19 +1415,15 @@ export function render({ navigate, route, chrome }) {
|
|||||||
createInMyBtn.style.display = '';
|
createInMyBtn.style.display = '';
|
||||||
topMenuBtn.style.display = '';
|
topMenuBtn.style.display = '';
|
||||||
if (topTitle.parentElement !== topBarLeft) topBarLeft.append(topTitle);
|
if (topTitle.parentElement !== topBarLeft) topBarLeft.append(topTitle);
|
||||||
|
|
||||||
updateBottomCta({ button: bottomCta });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
chrome?.setTopbar(topBarEl);
|
chrome?.setTopbar(topBarEl);
|
||||||
screen.append(contentEl, bottomCta);
|
screen.append(contentEl);
|
||||||
|
|
||||||
if (createSuccessFlash) {
|
if (createSuccessFlash) {
|
||||||
showToast(createSuccessFlash);
|
showToast(createSuccessFlash);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateBottomCta({ button: bottomCta });
|
|
||||||
|
|
||||||
// Применяем корректное состояние хедера сразу на первом рендере,
|
// Применяем корректное состояние хедера сразу на первом рендере,
|
||||||
// чтобы не показывать лишние кнопки до первой перерисовки.
|
// чтобы не показывать лишние кнопки до первой перерисовки.
|
||||||
rerenderList();
|
rerenderList();
|
||||||
|
|||||||
Reference in New Issue
Block a user