Skip to content

Commit adf6801

Browse files
committed
update styles for scrollbar in feed container
1 parent 046068d commit adf6801

File tree

6 files changed

+11
-17
lines changed

6 files changed

+11
-17
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"relay-compiler": "^13.0.2",
6666
"relay-compiler-language-typescript": "^15.0.1",
6767
"relay-config": "^12.0.1",
68+
"tailwind-scrollbar": "^2.0.1",
6869
"tailwindcss": "^3.0.23",
6970
"typescript": "4.5.5"
7071
},

src/components/feed/Feed.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useEffect, useState } from 'react'
21
import { graphql, usePaginationFragment } from 'react-relay'
32
import { Virtuoso } from 'react-virtuoso'
43
import { FeedsQuery$key } from '../../queries/__generated__/FeedsQuery.graphql'
@@ -32,9 +31,9 @@ const Feed = ({ root }: FeedProps) => {
3231
)
3332

3433
return (
35-
<>
34+
<div>
3635
<Virtuoso
37-
className="min-h-screen virtuoso-container"
36+
className="min-h-screen scrollbar-thin scrollbar-thumb-gray-400 dark:scrollbar-thumb-gray-700 scrollbar-track-gray-300 dark:scrollbar-track-gray-500"
3837
data={data.feeds.edges}
3938
endReached={loadNext}
4039
overscan={200}
@@ -44,15 +43,7 @@ const Feed = ({ root }: FeedProps) => {
4443
)
4544
}}
4645
/>
47-
<style jsx>
48-
{`
49-
// hide scrollbar
50-
-webkit-scrollbar {
51-
display: none;
52-
}
53-
`}
54-
</style>
55-
</>
46+
</div>
5647
)
5748
}
5849

src/components/feed/StoryPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const StoryPreview = ({ story }: StoryPreviewProps) => {
3232

3333
return (
3434
<ErrorBoundary FallbackComponent={ErrorFallback}>
35-
<div className="my-8 flex flex-col bg-white dark:bg-dark-700 rounded-lg">
35+
<div className="my-8 mr-2 flex flex-col bg-white dark:bg-dark-700 rounded-lg">
3636
<div>
3737
{data.thumbnail ? (
3838
<img className="cover-image" src={data.thumbnail} alt="" />

src/pages/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import { withRelay, RelayProps } from 'relay-nextjs'
55
import { pages_UserQuery } from '../queries/__generated__/pages_UserQuery.graphql'
66
import { getClientEnvironment } from '../lib/client_environment'
77
import Card from '../components/Card'
8-
import RelevantIssues from '../components/issue/RelevantIssues'
9-
import IssuesFromLastRepo from '../components/issue/IssuesFromLastRepo'
10-
import IssuesFromRecentRepos from '../components/issue/IssuesFromRecentRepo'
118
import Layout from '../components/Layout'
129
import Login from '../components/Login'
1310
import Feed from '../components/feed/Feed'

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ module.exports = {
2222
},
2323
},
2424
darkMode: 'class',
25-
plugins: [require('@tailwindcss/typography')],
25+
plugins: [require('@tailwindcss/typography'), require('tailwind-scrollbar')],
2626
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,6 +3034,11 @@ supports-preserve-symlinks-flag@^1.0.0:
30343034
resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz"
30353035
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
30363036

3037+
tailwind-scrollbar@^2.0.1:
3038+
version "2.0.1"
3039+
resolved "https://registry.yarnpkg.com/tailwind-scrollbar/-/tailwind-scrollbar-2.0.1.tgz#f08721173d513f1406a44601640b79726e3f9728"
3040+
integrity sha512-OcR7qHBbux4k+k6bWqnEQFYFooLK/F4dhkBz6nvswIoaA9ancZ5h20e0tyV7ifSWLDCUBtpG+1NHRA8HMRH/wg==
3041+
30373042
tailwindcss@^3.0.23:
30383043
version "3.0.23"
30393044
resolved "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.23.tgz"

0 commit comments

Comments
 (0)