Skip to content

Commit

Permalink
Moved comment, changed type and removed optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
Pdzly committed Jan 8, 2024
1 parent 1bc91f1 commit 5a41b03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import cx from 'classnames';

interface ButtonProps {
children: React.ReactNode;
type: 'button' | 'submit' | 'reset' | undefined;
type: 'button' | 'submit' | 'reset';
id?: string;
ariaLabel?: string;
active?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions src/components/front-page-feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ interface FeedProps {
}

const Feed = ({ posts }: FeedProps) => {
// @todo: Allow test data when in non-docker dev env
// as Sublinks Core doesn't yet handle all post features
const [postFeed, setPostFeed] = useState<GetPostsResponse>(posts);

// @todo: Set this to the users default feed type
const [postFeedType, setPostFeedType] = useState<ListingType>();
const [postFeedSort, setPostFeedSort] = useState<SortType>();

// @todo: Allow test data when in non-docker dev env
// as Sublinks Core doesn't yet handle all post features
useEffect(() => {
async function getPosts() {
setPostFeed(process.env.SUBLINKS_API_BASE_URL ? await sublinksClient().getPosts({
Expand All @@ -44,7 +44,7 @@ const Feed = ({ posts }: FeedProps) => {
currentSort={postFeedSort}
/>
</div>
<PostFeed data={postFeed?.posts || []} />
<PostFeed data={postFeed.posts} />
</div>
);
};
Expand Down

0 comments on commit 5a41b03

Please sign in to comment.