Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

🚨 ⚰️ remove unused css, fix linting issues in HN

Josua Blejeru7e1057d05985
diff --git a/src/components/Widgets/HackernewsTrending.vue b/src/components/Widgets/HackernewsTrending.vue
index dad694fd..1698150a 100644
--- a/src/components/Widgets/HackernewsTrending.vue
+++ b/src/components/Widgets/HackernewsTrending.vue
@@ -6,12 +6,10 @@
<a class="post-top" :href="trendingPosts.originURL">
<div class="post-title-wrap">
<p class="post-title">{{ trendingPosts.title }}</p>
- <div class="score-wrap">
<p class="post-date">
{{ formatDate(trendingPosts.time) }}
</p>
- <p class="post-date" v-if="trendingPosts.score">score: {{ trendingPosts.score }}</p>
- </div>
+ <p class="post-score" v-if="trendingPosts.score">score: {{ trendingPosts.score }}</p>
</div>
</a>
</div>
@@ -53,20 +51,19 @@ export default {
const allData = topPosts.map((post) => {
const url = `${widgetApiEndpoints.hackernewsTrending}/item/${post}.json`;
return this.makeRequest(url);
- })
+ });
Promise.all(allData).then((resolvedPostValues) => {
this.trendingPosts = resolvedPostValues.map((element, index) => {
- element.originURL = `https://news.ycombinator.com/item?id=${topPosts.at(index)}`
- return element
+ const trendingPost = { ...element, originURL: `https://news.ycombinator.com/item?id=${topPosts.at(index)}` };
+ return trendingPost;
});
- console.log(this.trendingPosts)
});
},
formatDate(unixTime) {
- const date = new Date(unixTime * 1000);
- // Then specify how you want your dates to be formatted
- return new Intl.DateTimeFormat('default', {dateStyle: 'long'}).format(date);
- }
+ const date = new Date(unixTime * 1000);
+ // Then specify how you want your dates to be formatted
+ return new Intl.DateTimeFormat('default', { dateStyle: 'long' }).format(date);
+ },
},
};
</script>
@@ -117,39 +114,12 @@ export default {
opacity: var(--dimming-factor);
color: var(--widget-text-color);
}
- img.post-img {
- border-radius: var(--curve-factor);
- width: 2rem;
- height: 2rem;
- margin-right: 0.5rem;
- }
- }
- .post-body {
- font-size: 0.85rem;
- color: var(--widget-text-color);
- max-height: 400px;
- overflow: hidden;
- ::v-deep p {
- margin: 0.5rem 0;
- }
- ::v-deep img {
- max-width: 80%;
- display: flex;
- margin: 0 auto;
- border-radius: var(--curve-factor);
- }
- ::v-deep a {
+ p.post-score {
+ font-size: 0.8rem;
+ margin: 0;
+ opacity: var(--dimming-factor);
color: var(--widget-text-color);
}
- ::v-deep svg path {
- fill: var(--widget-text-color);
- }
- ::v-deep blockquote {
- margin-left: 0.5rem;
- padding-left: 0.5rem;
- border-left: 4px solid var(--widget-text-color);
- }
- ::v-deep .avatar.avatar-user { display: none; }
}
}
}