Skip to content

Commit

Permalink
feat(ui): teleport history list
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Jan 16, 2023
1 parent f88fce9 commit bddbfd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<div id="app"></div>
<div id="history-container-shown-by-default"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
21 changes: 18 additions & 3 deletions src/components/CalculatorContainer/HistoryContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,24 @@ function revertToChosenHistory(historyItem: HistoryItem) {
</div>
</ul>

<ul class="history-list shown-by-default">
<div class="history-item" />
</ul>
<Teleport to="#history-container-shown-by-default">
<ul class="history-list shown-by-default">
<span class="header-text">History</span>
<!-- <div v-if="hasHistoryItems" class="has-history-items">
<HistoryListItem
v-for="item in historyList"
:key="joinHistoryItemParts(item)"
:history-item="item"
class="list-item"
@click="revertToChosenHistory(item)"
/>
</div>
<div v-else class="no-history-items">
No history yet.
</div> -->
</ul>
</Teleport>
</div>
</template>

Expand Down

0 comments on commit bddbfd5

Please sign in to comment.