Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
864
Issues
864
List
Boards
Labels
Service Desk
Milestones
Merge Requests
53
Merge Requests
53
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
1a8353f0
Commit
1a8353f0
authored
11 hours ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(refactor): Homepage (Mk2)
parent
b69644b1
epic/minds-pro
1 merge request
!486
WIP: (feat): Minds Pro (development branch) - Release 2
Pipeline
#77004342
passed with stages
in 27 minutes and 23 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
32 deletions
+48
-32
home.component.html
src/app/modules/pro/channel/home/home.component.html
+5
-13
home.component.scss
src/app/modules/pro/channel/home/home.component.scss
+18
-6
home.component.ts
src/app/modules/pro/channel/home/home.component.ts
+13
-5
list.component.html
src/app/modules/pro/channel/list/list.component.html
+1
-1
list.component.ts
src/app/modules/pro/channel/list/list.component.ts
+11
-7
No files found.
src/app/modules/pro/channel/home/home.component.html
View file @
1a8353f0
...
...
@@ -10,20 +10,12 @@
</div>
</div>
<div
class=
"m-pro--channel-home--section"
*ngIf=
"content?.length"
>
<h2
i18n
>
Top Content
</h2>
<div
class=
"m-pro--channel-home--content"
>
<m-pro--channel-tile
*ngFor=
"let entity of content"
[entity]=
"entity"
(click)=
"onContentClick(entity)"
></m-pro--channel-tile>
</div>
</div>
<div
class=
"m-pro--channel-home--section"
*ngFor=
"let category of categories"
>
<h2
i18n
>
{{ category?.tag?.label }}
</h2>
<h2
i18n
>
<a
[routerLink]=
"getCategoryRoute(category.tag?.tag)"
>
{{ category.tag?.label }}
</a>
</h2>
<div
class=
"m-pro--channel-home--category-content"
>
<ng-container
*ngFor=
"let entity$ of category?.content"
>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.scss
View file @
1a8353f0
...
...
@@ -15,6 +15,11 @@
font-weight
:
300
;
letter-spacing
:
2px
;
line-height
:
1
.25
;
>
a
{
font
:
inherit
;
text-decoration
:
none
;
}
}
}
...
...
@@ -24,7 +29,7 @@
}
.m-pro--channel-home--featured-content
,
.m-pro--channel-home--content
{
.m-pro--channel-home--c
ategory-c
ontent
{
width
:
80%
;
margin
:
0
auto
;
display
:
grid
;
...
...
@@ -36,23 +41,30 @@
}
.m-pro--channel-home--featured-content
{
grid-template-columns
:
repeat
(
2
,
1fr
);
grid-template-columns
:
repeat
(
4
,
1fr
);
*
:nth-child
(
1
)
{
grid-column
:
span
4
;
}
*
:first-child
{
*
:nth-child
(
2
),
*
:nth-child
(
3
)
{
grid-column
:
span
2
;
}
@media
screen
and
(
max-width
:
$max-mobile
)
{
grid-template-columns
:
repeat
(
1
,
1fr
);
*
:first-child
{
*
:nth-child
(
1
),
*
:nth-child
(
2
),
*
:nth-child
(
3
)
{
grid-column
:
initial
;
}
}
}
.m-pro--channel-home--content
{
grid-template-columns
:
repeat
(
3
,
1fr
);
.m-pro--channel-home--c
ategory-c
ontent
{
grid-template-columns
:
repeat
(
4
,
1fr
);
@media
screen
and
(
max-width
:
$max-mobile
)
{
grid-template-columns
:
repeat
(
1
,
1fr
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/home/home.component.ts
View file @
1a8353f0
...
...
@@ -14,8 +14,6 @@ export class ProChannelHomeComponent implements OnInit {
featuredContent
:
Array
<
any
>
=
[];
content
:
Array
<
any
>
=
[];
categories
:
Array
<
{
tag
:
{
tag
:
string
,
label
:
string
},
content
:
Array
<
Observable
<
any
>>
,
...
...
@@ -35,9 +33,11 @@ export class ProChannelHomeComponent implements OnInit {
}
async
load
()
{
const
MAX_FEATURED_CONTENT
=
19
;
// 1 + 2 + (4 * 4)
this
.
inProgress
=
true
;
this
.
featuredContent
=
[];
this
.
c
ontent
=
[];
this
.
c
ategories
=
[];
this
.
moreData
=
true
;
this
.
detectChanges
();
...
...
@@ -47,9 +47,9 @@ export class ProChannelHomeComponent implements OnInit {
this
.
detectChanges
();
const
{
content
}
=
await
this
.
channelService
.
getContent
({
limit
:
24
,
limit
:
MAX_FEATURED_CONTENT
,
});
this
.
content
.
push
(...
content
);
this
.
featuredContent
=
this
.
featuredContent
.
concat
(
content
).
slice
(
0
,
MAX_FEATURED_CONTENT
);
this
.
detectChanges
();
this
.
categories
=
await
this
.
channelService
.
getAllCategoriesContent
();
...
...
@@ -62,6 +62,14 @@ export class ProChannelHomeComponent implements OnInit {
this
.
detectChanges
();
}
getCategoryRoute
(
tag
)
{
if
(
!
this
.
channelService
.
currentChannel
||
!
tag
)
{
return
[];
}
return
[
'
/pro
'
,
this
.
channelService
.
currentChannel
.
username
,
'
all
'
,
{
hashtag
:
tag
}];
}
onContentClick
(
entity
:
any
)
{
return
this
.
channelService
.
open
(
entity
,
this
.
modalService
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/list/list.component.html
View file @
1a8353f0
...
...
@@ -13,7 +13,7 @@
<div
class=
"m-proChannelList__content"
>
<ul
class=
"m-proChannelListContent__list"
[class.m-proChannelListContent__normalList]=
"type === 'activities'"
>
<li
*ngFor=
"let entity of entities; let i = index"
>
<ng-container
*ngIf=
"type === 'images' || type === 'videos' || type === 'blogs'"
>
<ng-container
*ngIf=
"type === '
all' || type === '
images' || type === 'videos' || type === 'blogs'"
>
<m-pro--channel-tile
[entity]=
"entity"
(click)=
"onTileClicked(entity)"
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/list/list.component.ts
View file @
1a8353f0
...
...
@@ -58,6 +58,9 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
this
.
type
=
this
.
paramsType
=
params
[
'
type
'
];
}
switch
(
params
[
'
type
'
])
{
case
'
all
'
:
this
.
type
=
'
all
'
;
break
;
case
'
videos
'
:
this
.
type
=
'
videos
'
;
break
;
...
...
@@ -121,25 +124,26 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
this
.
detectChanges
();
let
params
=
[]
;
let
params
:
any
=
{}
;
if
(
this
.
selectedHashtag
&&
this
.
selectedHashtag
!==
'
all
'
)
{
params
.
push
(
`hashtags=
${
this
.
selectedHashtag
}
`
)
;
params
.
hashtags
=
this
.
selectedHashtag
;
}
if
(
this
.
query
&&
(
this
.
query
!==
''
))
{
params
.
push
(
`&period=
${
this
.
period
}
&all=1&query=
${
this
.
query
}
&nsfw=&sync=1&limit=150&as_activities=1&from_timestamp=`
);
params
.
period
=
this
.
period
;
params
.
all
=
1
;
params
.
query
=
this
.
query
;
params
.
sync
=
1
;
}
let
url
=
`api/v2/feeds/channel/
${
this
.
channelService
.
currentChannel
.
guid
}
/
${
this
.
type
}
/
${
this
.
algorithm
}
`
;
if
(
params
.
length
>
0
)
{
url
+=
'
?
'
+
params
.
join
(
'
&
'
);
}
try
{
this
.
feedsService
.
setEndpoint
(
url
)
.
setParams
(
params
)
.
setCastToActivities
(
false
)
.
setLimit
(
10
)
.
fetch
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment