mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	add ability to conditionally wrap toast message in Mfm tag
This commit is contained in:
		
							parent
							
								
									c8535b5d26
								
							
						
					
					
						commit
						ce197bc2e6
					
				
					 2 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
					@ -14,7 +14,8 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
				
			||||||
	>
 | 
						>
 | 
				
			||||||
		<div v-if="showing" class="_acrylic" :class="$style.root" :style="{ zIndex }">
 | 
							<div v-if="showing" class="_acrylic" :class="$style.root" :style="{ zIndex }">
 | 
				
			||||||
			<div style="padding: 16px 24px;">
 | 
								<div style="padding: 16px 24px;">
 | 
				
			||||||
				<Mfm :text="message" plain="true"/>
 | 
									<Mfm v-if="renderMfm" :text="message" plain/>
 | 
				
			||||||
 | 
									<template v-else>{{ message }}</template>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</Transition>
 | 
						</Transition>
 | 
				
			||||||
| 
						 | 
					@ -26,9 +27,12 @@ import { onMounted, ref } from 'vue';
 | 
				
			||||||
import * as os from '@/os.js';
 | 
					import * as os from '@/os.js';
 | 
				
			||||||
import { defaultStore } from '@/store.js';
 | 
					import { defaultStore } from '@/store.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
defineProps<{
 | 
					withDefaults(defineProps<{
 | 
				
			||||||
	message: string;
 | 
						message: string;
 | 
				
			||||||
}>();
 | 
						renderMfm: boolean;
 | 
				
			||||||
 | 
					}>(), {
 | 
				
			||||||
 | 
						renderMfm: false,
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const emit = defineEmits<{
 | 
					const emit = defineEmits<{
 | 
				
			||||||
	(ev: 'closed'): void;
 | 
						(ev: 'closed'): void;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -211,9 +211,10 @@ export function pageWindow(path: string) {
 | 
				
			||||||
	}, {}, 'closed');
 | 
						}, {}, 'closed');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function toast(message: string) {
 | 
					export function toast(message: string, renderMfm = false) {
 | 
				
			||||||
	popup(MkToast, {
 | 
						popup(MkToast, {
 | 
				
			||||||
		message,
 | 
							message,
 | 
				
			||||||
 | 
							renderMfm,
 | 
				
			||||||
	}, {}, 'closed');
 | 
						}, {}, 'closed');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue