Skip to content

Commit

Permalink
feat: add iconoir-react dependency, update component styles, and refi…
Browse files Browse the repository at this point in the history
…ne layout for FeedList and PodcastCard
  • Loading branch information
BumpyClock committed Sep 25, 2024
1 parent 434e9d9 commit 8005400
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 78 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@testing-library/user-event": "^13.5.0",
"dompurify": "^3.0.8",
"framer-motion": "^10.18.0",
"iconoir-react": "^7.9.0",
"jsdom": "^23.2.0",
"react": "^18.2.0",
"react-content-loader": "^6.2.1",
Expand Down
1 change: 1 addition & 0 deletions public/assets/icons/podcast.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/AppBar/AppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const AppBar = ({ isScrolled, refreshFeed, isListView, setIsListView, showSettin
<SlIconButton
className="icon-button"
name="rss-feed"
id="podcastButton"
id="rssFeedButton"
size="large"
library="iconoir"
style={{
Expand All @@ -48,7 +48,7 @@ const AppBar = ({ isScrolled, refreshFeed, isListView, setIsListView, showSettin
<SlIconButton
className="icon-button"
name="bookmark"
id="rssButton"
id="bookmarkButton"
size="large"
library="iconoir"
style={{
Expand Down
3 changes: 2 additions & 1 deletion src/components/FeedCard/FeedCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ sl-card {
-webkit-border-radius: 0 0 40px;
border-radius: 0 0 40px;
background-position: center center;
z-index: 1;
z-index: -1;
top: 0;
width: 100%;
height: 100%;
Expand Down Expand Up @@ -206,6 +206,7 @@ card:hover .card-bg {
border-radius: 32px;
}
.card .text-content {
position: relative;
display: flex;
row-gap: 4px;
flex-direction: column;
Expand Down
92 changes: 72 additions & 20 deletions src/components/FeedList/FeedList.css
Original file line number Diff line number Diff line change
@@ -1,46 +1,89 @@
.feed-list {

height: fit-content;

}

.feed-list sl-card{
border-radius: 24px;
border:none;
--padding:0px;
background-color: var(--background-color-secondary);


}

.feed-card::part(base){
background-color: var(--background-color-secondary);
border: none;
border:1px solid var(--border-color) !important;
border-radius: 24px;

height: auto;
break-inside: avoid;
box-shadow: var(--box-shadow-standard);
max-width: 600px;
margin: 0 auto;
width: -webkit-fill-available;
}

.feed-card-content {
display: flex;
flex-direction: column;
gap: 16px;
}

.feed-card {
border: 1px solid #ddd;
border-radius: 8px;
justify-content: space-between;
height: 100%;


padding: 16px;
background-color: white;
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1);
max-width: 600px;
margin: 0 auto;
break-inside: avoid;
flex-grow:1;
}

.feed-card-header {
display: flex;
align-items: center;
margin-bottom: 16px;
margin-bottom: 24px;
flex-wrap: wrap;
}

.feed-icon {
width: 48px;
height: 48px;
border-radius: 50%;
width: 64px;
height: 64px;
border-radius: 4px;
margin-right: 16px;
/* border: 1px solid var(--border-color); */
border-radius: 4px;
object-fit: cover;

}

.feed-info {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: left;
row-gap: 4px;
}

.feed-title {
margin: 0;
font-size: 1.25rem;
font-size: 1.05rem;
padding: 0;
}

.feed-url {
.feed-url , .feed-url a{
font-size: 0.875rem;
color: #666;
width: -webkit-fill-available;
color: var(--color);
opacity: 0.9;
text-decoration: none;
margin-top: 4px;
line-height: 1;
margin: 0px;
display:-webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;

}

.feed-url:hover {
Expand Down Expand Up @@ -72,11 +115,20 @@

.feed-description {
margin-bottom: 16px;
color: var(--color);
opacity: 0.8;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;

}

.feed-description p {
margin: 0 0 8px;
color: #444;
font-size: .8rem;

}

.feed-description ul {
Expand Down
73 changes: 43 additions & 30 deletions src/components/FeedList/FeedList.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,55 @@
import React from "react";
import "./FeedList.css";
import Slbutton from "@shoelace-style/shoelace/dist/react/button";
import SlCard from "@shoelace-style/shoelace/dist/react/card";
import Masonry, { ResponsiveMasonry } from "react-responsive-masonry";

const FeedList = ({ feeds, onRemoveFeed }) => {
const gutterSize = "12px"; // Define the gutter size

const FeedList = ({ feeds }) => {
return (
<div className="feed-list">
{feeds.map((feed, index) => (
<div className="feed-card" key={index}>
<div className="feed-card-header">
<img
src={feed.favicon}
alt={`${feed.feedTitle} icon`}
className="feed-icon"
/>
<div className="feed-info">
<h3 className="feed-title">{feed.siteTitle}</h3>
<a href={feed.url} target="_blank" rel="noopener noreferrer" className="feed-url">
{feed.feedUrl}
</a>
<div className="feed-actions">

<Slbutton >Similar Feeds</Slbutton>
<ResponsiveMasonry
columnsCountBreakPoints={{ 450:1, 550: 1, 650:2, 1200: 2 }}
style={{ margin: '24px 24px' }}

>
<Masonry gutter={gutterSize}>
{feeds.map((feed, index) => (
<SlCard className="feed-card">
<div className="feed-card-content" key={index}>
<div className="feed-card-header">
<img
src={feed.favicon}
alt={`${feed.feedTitle} icon`}
className="feed-icon"
/>
<div className="feed-info">
<h3 className="feed-title">{feed.siteTitle}</h3>
<div className="feed-url">
<a href={feed.url} target="_blank" rel="noopener noreferrer" className="feed-url">
{feed.feedUrl}
</a>
</div>

</div>
</div>
<div className="feed-description">
<p>{feed.description}</p>
</div>
<div className="feed-stats">

</div>
<div className="feed-actions">
<Slbutton onClick={()=> onRemoveFeed(feed.feedUrl)}>Remove feed</Slbutton>
</div>
</div>
</div>
<div className="feed-description">
<p>{feed.description}</p>


</div>
<div className="feed-stats">
<span>{feed.followers} followers</span>
<span>{feed.articlesPerWeek} articles per week</span>
</div>
</div>
))}
</SlCard>
))}
</Masonry>
</ResponsiveMasonry>
</div>
);
};

export default FeedList;
export default FeedList;
64 changes: 63 additions & 1 deletion src/components/PodcastCard/PodcastCard.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@
.card .podcast-audio-player {
.podcast-card {
overflow: hidden;
position: relative;
padding: 0;
row-gap: 0;
-webkit-border-radius: 40px;
border-radius: 40px;
width: 100%;
display: flex;
flex-direction: column;
height: auto;
max-width: 950px;
margin-top: 12px;
break-inside: avoid;
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
transition: all .25s ease-in-out !important;
}
.podcast-card .podcast-audio-player {
width: 100%;
margin: 20px 0;
}

.podcast-card .podcast-image-header {
width: 100%;
max-height: 300px;
width: 100%;
overflow: hidden;
border-radius: 24px;
align-content: center;
}

.podcast-card .podcast-image-header, .podcast-image-header img {
min-height: 150px;
border-radius: 4px;
overflow: hidden;
position: relative;




}

.podcast-card .background-image {
width: 100%;
height: fit-content;
min-height: 150px;
object-fit: cover;
border-radius: 24px;
transition: all .25s ease-in-out;
filter: blur(35px) brightness(.7);
opacity: .5;
position: absolute;
top:0;
left:0;
}

.podcast-card .podcast-image-header .icon-container, .podcast-card .podcast-image-header .icon-container img {
width: 96px !important;
height: 96px !important;
min-height: 32px !important;
margin:auto;
border-radius: 4px;
object-fit: cover;

}
Loading

0 comments on commit 8005400

Please sign in to comment.