Make Theme Preview sort based on createdAt propert. Fix Admin Editor Form youtube preview layout slip.

This commit is contained in:
Hikmet 2024-04-21 14:34:05 +03:00
parent 0063cecf5d
commit ebf62192b2
3 changed files with 7 additions and 5 deletions

View File

@ -83,9 +83,7 @@ export default function EditorForm() {
<YouTube
style={{
visibility: "hidden",
position: "absolute",
top: "999vh",
left: "999vw",
height: 0,
}}
videoId={
getYouTubeID(youtubeVideoUrl.value) ??

View File

@ -49,7 +49,9 @@ export default function AdminPage() {
</Head>
<LandingPageView
home="/admin"
themePreviews={themeMetas}
themePreviews={themeMetas.sort((a, b) =>
a.createdAt > b.createdAt ? 1 : -1
)}
createNewThemeButton={
<button
disabled={stalling}

View File

@ -28,7 +28,9 @@ export async function getStaticProps() {
if (res.status === "success" && res.data) {
return {
props: {
themeMetas: res.data,
themeMetas: res.data.sort((a, b) =>
a.createdAt > b.createdAt ? 1 : -1
),
},
};
}