Skip to content

Commit

Permalink
remove print button at dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
everywherejacobkim committed Oct 18, 2023
1 parent af0db73 commit baad28f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
31 changes: 1 addition & 30 deletions src/lib/components/AdminTable.svelte
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
<script lang="ts">
import DataTable, {Head, Body, Row, Cell} from '@smui/data-table'
import {activeTickets, cancelledTickets} from '$lib/store'
import exportExcel from '$lib/exportExcel'
import type {Table} from 'airtable'
import * as XLSX from 'xlsx'
export let events: DB.Event[]
let initBodyHtml: string | null = null
function printContent() {
window.print()
}
function beforePrint() {
initBodyHtml = document.body.innerHTML
document.body.innerHTML = document.getElementById('print-area')?.innerHTML as string
}
function afterPrint() {
if (initBodyHtml !== null) {
document.body.innerHTML = initBodyHtml
initBodyHtml = null
}
}
window.onbeforeprint = beforePrint
window.onafterprint = afterPrint
let ticketTable: HTMLTableElement
function exportData(type: string) {
Expand All @@ -40,12 +16,7 @@

<div>
<button
class="hidden md:block absolute top-0 right-24 m-7 bg-royalBlue-500/75 hover:bg-royalBlue-500 text-white font-bold py-2 px-4 rounded-lg"
on:click={printContent}>
Print
</button>
<button
class="hidden md:block absolute top-0 right-44 m-7 bg-amber-300/75 hover:bg-amber-400 text-white font-bold py-2 px-4 rounded-lg"
class="hidden md:block absolute top-0 right-24 m-7 bg-amber-400/75 hover:bg-amber-400 text-white font-bold py-2 px-4 rounded-lg"
on:click={() => {
exportData('csv')
}}>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/Drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</script>

<div class="flex flex-col md:flex-row h-full">
<Drawer class="md:w-80 max-h-screen">
<Drawer class="md:w-60 max-h-screen">
<Content class="h-full w-60">
<List class="flex-start flex-row md:flex-col gap-2 p-1 md:p-2 h-full overflow-auto">
{#each events as event}
Expand All @@ -29,7 +29,7 @@
</Content>
</Drawer>

<AppContent class="flex-auto pb-8">
<AppContent class="flex-auto pb-8 w-full h-full">
<main class="h-full w-full">
<List class="flex-start flex-col gap-1 h-full horizontal-overflow-auto w-[150%] p-2">
{#if ticketValue && ticketValue.size > 0}
Expand Down

0 comments on commit baad28f

Please sign in to comment.