Skip to content
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

Add logic for posts and comments #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AlexanderBoriskin
Copy link
Collaborator

close #1
close #2

@@ -26,6 +35,13 @@
]),
subredditTitle () {
return this.selectedSubreddit ? `- ${this.selectedSubreddit}` : ''
},
isHome () {
if (this.$route.name === 'Subreddit') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant construction

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, can we do it some other, more beautiful way (no === 'Subreddit)?

@@ -37,5 +53,8 @@
</script>

<style>

.back-button {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe, vuetify has some prebuild button? explore it's docs


<script>
export default {
name: 'CommentsItem',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to SelectedPostComment

import CommentsItem from './CommentsItem'

export default {
name: 'PostsItem',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to SelectedPost

},
computed: {
...mapGetters('posts', {
openedPost: 'openedPost',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

selectedPost

{
path: '/:id',
name: 'Post',
component: PostsItem
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename everywhere

@@ -0,0 +1,63 @@
<template>
<div class="posts-item">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Play with vuetify components - everything might look much better (cards, panels etc)

@@ -0,0 +1,63 @@
<template>
<div class="posts-item">
<h1>{{ openedPost.title }}</h1>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it good to split Post component to wrapper, body (3 types) and comments list?

@@ -0,0 +1,33 @@
<template>
<div class="comments-item">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

play with styles - no border bottom, no strange icon. Some user info (eg name, time, upvotes - inspire from reddit and ionic2-reddit-reader)

Collapse/expand would be good

@@ -5,14 +5,22 @@ export default {
state: {
error: null,
isLoading: false,
posts: []
openedPost: localStorage.getItem('openedPost') ? JSON.parse(localStorage.getItem('openedPost')) : '',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think we need local storage here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post's comments section Open links in a new tab after clicking on a relevant post
2 participants