1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

change source headings

This commit is contained in:
James Hawkins 2021-07-22 21:11:53 +01:00
parent 98d076f4e9
commit ffabfa4866
5 changed files with 30 additions and 11 deletions

View file

@ -24,7 +24,6 @@ export function MovieRow(props) {
<span className="year">({props.year})</span> <span className="year">({props.year})</span>
</div> </div>
<div className="watch"> <div className="watch">
<span className="attribute">{props.source}</span>
<p>Watch {props.type}</p> <p>Watch {props.type}</p>
<Arrow/> <Arrow/>
</div> </div>

View file

@ -22,6 +22,8 @@
--choice: #2E2F37; --choice: #2E2F37;
--choice-hover: #45464D; --choice-hover: #45464D;
--choice-active: #45464D; --choice-active: #45464D;
--source-headings: #5b5c63;
} }
/* @media (prefers-color-scheme: light) { /* @media (prefers-color-scheme: light) {
:root { :root {

View file

@ -35,7 +35,7 @@ async function findContent(searchTerm, type) {
if (results.length > 1) { if (results.length > 1) {
return { options: results }; return { options: results };
} else { } else {
return { options: [ { ...results[0], source: 'gomostream' } ] } return { options: [ results[0] ] }
} }
} catch (err) { } catch (err) {
console.error(err); console.error(err);

View file

@ -40,3 +40,11 @@
.topRightCredits a:hover .arrow { .topRightCredits a:hover .arrow {
transform: translateY(.1rem) translateX(.2rem); transform: translateY(.1rem) translateX(.2rem);
} }
p.source {
text-transform: uppercase;
font-weight: bold;
color: var(--source-headings);
font-size: 0.8em;
margin-top: 2rem;
}

View file

@ -128,7 +128,7 @@ export function SearchView() {
noWrap={true} noWrap={true}
selected={type} selected={type}
/> />
<InputBox placeholder={ type === "movie" ? "Hamilton" : "Atypical" } onSubmit={(str) => searchMovie(str, type)} /> <InputBox placeholder={type === "movie" ? "Hamilton" : "Atypical"} onSubmit={(str) => searchMovie(str, type)} />
<Progress show={progress > 0} failed={failed} progress={progress} steps={maxSteps} text={text} /> <Progress show={progress > 0} failed={failed} progress={progress} steps={maxSteps} text={text} />
</Card> </Card>
@ -136,15 +136,25 @@ export function SearchView() {
<Title size="medium"> <Title size="medium">
Whoops, there are a few {type}s like that Whoops, there are a few {type}s like that
</Title> </Title>
{options?.map((v, i) => ( { Object.entries(options.reduce((a, v) => {
if (!a[v.source]) a[v.source] = []
a[v.source].push(v)
return a;
}, {})).map(v => (
<div key={v[0]}>
<p className="source">{v[0]}</p>
{v[1].map((v, i) => (
<MovieRow key={i} title={v.title} slug={v.slug} type={v.type} year={v.year} source={v.source} onClick={() => { <MovieRow key={i} title={v.title} slug={v.slug} type={v.type} year={v.year} source={v.source} onClick={() => {
setShowingOptions(false) setShowingOptions(false)
getStream(v.title, v.slug, v.type, v.source) getStream(v.title, v.slug, v.type, v.source)
}}/> }} />
))} ))}
</div>
))
}
</Card> </Card>
<div className="topRightCredits"> <div className="topRightCredits">
<a href="https://github.com/JamesHawkinss/movie-web" target="_blank" rel="noreferrer">Check it out on GitHub <Arrow/></a> <a href="https://github.com/JamesHawkinss/movie-web" target="_blank" rel="noreferrer">Check it out on GitHub <Arrow /></a>
</div> </div>
</div> </div>
) )