refactor(components): change story overview card
make it show actions at the bottom depending on a prop `showActions`
This commit is contained in:
		
							parent
							
								
									8f24c9ff3d
								
							
						
					
					
						commit
						ff0787f75e
					
				| @ -1,5 +1,6 @@ | |||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| 	import type { IStory } from "@models/stories"; | 	import type { IStory } from "@models/stories"; | ||||||
|  | 	import StoryActions from "~/components/story/atoms/actions.vue"; | ||||||
| 	import { format } from "date-fns"; | 	import { format } from "date-fns"; | ||||||
| 	import icon from "../icon.vue"; | 	import icon from "../icon.vue"; | ||||||
| 	import { theme } from "ant-design-vue"; | 	import { theme } from "ant-design-vue"; | ||||||
| @ -9,7 +10,7 @@ | |||||||
| 	const { token } = useToken(); | 	const { token } = useToken(); | ||||||
| 	const dark = inject<Ref<boolean>>("dark"); | 	const dark = inject<Ref<boolean>>("dark"); | ||||||
| 	const { data } = useAuth(); | 	const { data } = useAuth(); | ||||||
| 	let prop = defineProps<{ story: IStory; last?: boolean }>(); | 	let prop = defineProps<{ story: IStory; last?: boolean; showActions?: boolean }>(); | ||||||
| 	const idxo = (prop.last || false ? prop.story.chapters.length : 1) - 1; | 	const idxo = (prop.last || false ? prop.story.chapters.length : 1) - 1; | ||||||
| 	// console.log("idx0->", idxo) | 	// console.log("idx0->", idxo) | ||||||
| 	// log.debug("posti->", prop.story.chapters[ prop.story.chapters.length - 1 ]); | 	// log.debug("posti->", prop.story.chapters[ prop.story.chapters.length - 1 ]); | ||||||
| @ -161,6 +162,9 @@ | |||||||
| 				</span> | 				</span> | ||||||
| 			</span> | 			</span> | ||||||
| 		</div> | 		</div> | ||||||
|  | 		<template #actions v-if="showActions || false"> | ||||||
|  | 			<story-actions :story="story" /> | ||||||
|  | 		</template> | ||||||
| 	</a-card> | 	</a-card> | ||||||
| </template> | </template> | ||||||
| <style> | <style> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user