mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
Refactor MkAnnouncement
This commit is contained in:
parent
8f3c0f480b
commit
54ac36868c
1 changed files with 14 additions and 27 deletions
|
@ -8,21 +8,13 @@
|
|||
<Mfm :text="text" />
|
||||
<img
|
||||
v-if="imageUrl != null"
|
||||
:style="$style.image"
|
||||
:key="imageUrl"
|
||||
:src="imageUrl"
|
||||
alt="attached image"
|
||||
/>
|
||||
<MkButton
|
||||
:class="$style.gotIt"
|
||||
primary
|
||||
full
|
||||
@click="
|
||||
$refs.modal.close();
|
||||
markAsRead();
|
||||
"
|
||||
>{{ i18n.ts.gotIt }}</MkButton
|
||||
>
|
||||
<MkButton :class="$style.gotIt" primary full @click="gotIt()">{{
|
||||
i18n.ts.gotIt
|
||||
}}</MkButton>
|
||||
</div>
|
||||
</MkModal>
|
||||
</template>
|
||||
|
@ -32,7 +24,6 @@ import { shallowRef } from "vue";
|
|||
import MkModal from "@/components/MkModal.vue";
|
||||
import MkSparkle from "@/components/MkSparkle.vue";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
import { version } from "@/config";
|
||||
import { i18n } from "@/i18n";
|
||||
import * as os from "@/os";
|
||||
|
||||
|
@ -44,9 +35,10 @@ const { id, text, title, imageUrl, isGoodNews } = props.announcement;
|
|||
|
||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
|
||||
|
||||
function markAsRead() {
|
||||
const gotIt = () => {
|
||||
modal.value.close();
|
||||
os.api("i/read-announcement", { announcementId: id });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@ -60,27 +52,22 @@ function markAsRead() {
|
|||
text-align: center;
|
||||
background: var(--panel);
|
||||
border-radius: var(--radius);
|
||||
|
||||
> img {
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.version {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.image {
|
||||
max-width: 500px;
|
||||
> p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.gotIt {
|
||||
margin: 8px 0 0 0;
|
||||
}
|
||||
|
||||
.releaseNotes {
|
||||
> img {
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in a new issue