-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[author] Implement author screen #38
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a lot of nitpicks with styling, but I didn't include all of them. Please pull up the Figma and go through every margin, size, and color again, there are a lot of issues. If you need help identifying what they are and how to implement them, please let me know.
Also, please rename your PR to match the title of your notion sprint task
src/queries/types.tsx
Outdated
@@ -9,3 +9,12 @@ export interface StoryPreview { | |||
tone: string[]; | |||
genre_medium: string[]; | |||
} | |||
|
|||
export interface AuthorInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just call this type Author?
src/queries/authors.tsx
Outdated
} | ||
} | ||
|
||
export async function fetchAllAuthorStoryPreviews( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consistency, this should be named fetchAuthorStoryPreviews.
src/queries/authors.tsx
Outdated
export async function fetchAllAuthorStoryPreviews( | ||
author_id: number, | ||
): Promise<StoryPreview[]> { | ||
const { data, error } = await supabase.rpc('fetch_author_story_preview', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename your supabase function to be fetch_author_story_previews
src/queries/authors.tsx
Outdated
const { data, error } = await supabase.rpc('fetch_author_story_preview', { | ||
input_author_id: author_id, | ||
}); | ||
console.log('TESTING QUERY OUTPUT:', data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
src/components/AuthorCard/styles.ts
Outdated
flexDirection: 'row', | ||
justifyContent: 'flex-start', | ||
flexWrap: 'wrap', | ||
paddingTop: 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete: add padding when you're using the component, not by definition
4108cbf
to
97c86f5
Compare
e6883eb
to
68552dc
Compare
What's new in this PR
- fetchAuthor takes in an authorID and returns author info object as shown in the types.tsx file
- fetchAllAuthorStoryPreviews takes in the same authorID, utilizes the fetch_author_story_preview query to return a list
of objects of stories written by the author that matches the authorID input
Relevant Links
Screen.Recording.2023-11-06.at.9.48.49.PM.mov
Notion Sprint Task
https://www.notion.so/calblueprint/b885547588f4406bb7f6f8153be99bb9?v=6572442cb5c644a9bd1c298d53a85eec&p=6fd60acf45644446ab3e6e842ebf5f4c&pm=s
Online sources
Related PRs
Waiting for Marcos StoryScreen PR to be able to dynamically load an AuthorID as a params to route to an author page
How to review
Next steps
Tests Performed, Edge Cases
N/A
Screenshots
CC: @akshaynthakur