Skip to content

Commit

Permalink
Merge branch 'master' into date-recency
Browse files Browse the repository at this point in the history
  • Loading branch information
kevkevinpal authored Nov 2, 2023
2 parents baf78e0 + 089c33f commit bf09e2f
Show file tree
Hide file tree
Showing 20 changed files with 278 additions and 8,378 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
- name: Install
run: yarn --immutable

- name: Unit tests
run: yarn test

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit tests
on:
pull_request:
branches:
- master
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install
run: yarn --immutable

- name: Unit tests
run: yarn test
8,266 changes: 0 additions & 8,266 deletions build/assets/index-3dbd5709.js

This file was deleted.

2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Second Brain</title>
<script type="module" crossorigin src="/assets/index-3dbd5709.js"></script>
<script type="module" crossorigin src="/assets/index-e8bee665.js"></script>
<link rel="stylesheet" href="/assets/index-381991a0.css">
</head>
<body style="background: #000">
Expand Down
30 changes: 11 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sphinx-nav",
"version": "0.1.95",
"version": "0.1.97",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
Expand Down Expand Up @@ -92,19 +92,19 @@
"lint": "eslint src --max-warnings 24"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"extends": ["react-app", "react-app/jest"]
},
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"./src/utils/**"
],
"collectCoverageFrom": ["./src/**/*.js", "./src/**/*.ts"],
"coverageThreshold": {
"global": {
"lines": 20
"lines": 0
},
"./src/utils/": {
"lines": 23,
"branches": 29,
"functions": 33
}
},
"moduleNameMapper": {
Expand All @@ -120,16 +120,8 @@
}
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"production": [">0.2%", "not dead", "not op_mini all"],
"development": ["last 1 chrome version", "last 1 firefox version", "last 1 safari version"]
},
"resolutions": {
"react-error-overlay": "6.0.9"
Expand Down
5 changes: 5 additions & 0 deletions public/svg-icons/LinkIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/AddContentModal/SourceStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SourceStep: FC<Props> = ({ type, onNextStep, value }) => (
<Flex mb={12}>
<TextInput
id="cy-youtube-channel-id"
maxLength={50}
maxLength={250}
name="source"
placeholder="Paste your url here..."
rules={{
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddSourceModal/SourceStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const SourceStep: FC<Props> = ({ onNextStep, value }) => (
</Flex>

<Flex mb={12}>
<TextInput id="cy-youtube-channel-id" maxLength={50} name="source" placeholder="Paste your url here..." />
<TextInput id="cy-youtube-channel-id" maxLength={250} name="source" placeholder="Paste your url here..." />
</Flex>
<Flex>
<Button color="secondary" disabled={!value} onClick={onNextStep} size="large" variant="contained">
Expand Down
38 changes: 30 additions & 8 deletions src/components/App/Helper/BoostAmt.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
import { Text } from '~/components/common/Text'
import styled from 'styled-components'
import BoostIcon from '~/components/Icons/BoostIcon'
import { Flex } from '~/components/common/Flex'
import { colors } from '~/utils/colors'

type Props = {
amt: number
}
export const BoostAmt = ({ amt }: Props) => (
<div style={{ alignSelf: 'center' }}>
<BoostIcon />

<StyledText color="white">{amt}</StyledText>
</div>
<Wrapper align="center" direction="row" justify="flex-start">
<div className="icon">
<BoostIcon />
</div>
<div className="value">{amt}</div>
<div className="text">sat</div>
</Wrapper>
)

const StyledText = styled(Text)`
padding-left: 10px;
const Wrapper = styled(Flex)`
font-size: 13px;
font-style: normal;
font-weight: 500;
color: ${colors.GRAY7};
.icon {
width: 16px;
height: 16px;
border-radius: 2px;
background: ${colors.GRAY7};
color: ${colors.BG1};
font-size: 12px;
display: flex;
align-items: center;
justify-content: center;
}
.value {
margin: 0 4px 0 8px;
color: ${colors.white};
}
`
5 changes: 2 additions & 3 deletions src/components/App/MainToolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import styled from 'styled-components'
import AddContentIcon from '~/components/Icons/AddContentIcon'
import AddSourceIcon from '~/components/Icons/AddSourceIcon'
import SentimentDataIcon from '~/components/Icons/SentimentDataIcon'
import SettingsIcon from '~/components/Icons/SettingsIcon'
import SourcesTableIcon from '~/components/Icons/SourcesTableIcon'
import { Flex } from '~/components/common/Flex'
import { Text } from '~/components/common/Text'
Expand Down Expand Up @@ -50,12 +49,12 @@ export const MainToolbar = () => {
</IconWrapper>
<Text>Sentiment Data</Text>
</ActionButton>
<ActionButton onClick={openSourceAddModal}>
{/* <ActionButton onClick={openSourceAddModal}>
<IconWrapper>
<SettingsIcon />
</IconWrapper>
<Text>Change Display</Text>
</ActionButton>
</ActionButton> */}
</Wrapper>
)
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/App/Providers/MuiButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ export const MuiButton = {

'&.MuiButton-outlined': {},
},
textPrimary: {
'& .MuiButton-endIcon': {
color: colors.GRAY6,
},
'& .MuiButton-startIcon': {
color: colors.GRAY6,
},
},
outlined: {
// Add your custom styles here for the outlined variant
borderColor: colors.BUTTON1,
Expand Down
16 changes: 15 additions & 1 deletion src/components/App/SideBar/Relevance/Episode/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import moment from 'moment'
import styled from 'styled-components'
import { BoostAmt } from '~/components/App/Helper/BoostAmt'
import LinkIcon from '~/components/Icons/LinkIcon'
import { Avatar } from '~/components/common/Avatar'
import { Flex } from '~/components/common/Flex'
import { FlexboxProps } from '~/components/common/Flex/flexbox'
Expand Down Expand Up @@ -48,6 +49,7 @@ export type Props = {
imageUrl: string
showTitle?: string
text?: string
link?: string
type?: string
name?: string
verified?: boolean
Expand All @@ -69,6 +71,7 @@ export const Episode = ({
text,
name,
profilePicture,
link,
verified = false,
twitterHandle,
className = 'episode-wrapper',
Expand All @@ -83,7 +86,7 @@ export const Episode = ({
<Flex direction="row">
{!isSelectedView && (
<Flex align="center" pr={16}>
<Avatar src={imageUrl} type={type || ''} />
<Avatar size={64} src={imageUrl} type={type || ''} />
</Flex>
)}

Expand All @@ -92,6 +95,11 @@ export const Episode = ({
<Flex align="center" direction="row">
{type && <TypeBadge type={type} />}
</Flex>
{type === 'youtube' ? (
<StyledLink href={`${link}?open=system`} onClick={(e) => e.stopPropagation()}>
<LinkIcon />
</StyledLink>
) : null}
</Flex>

<Description data-testid="episode-description">{episodeTitle}</Description>
Expand Down Expand Up @@ -174,3 +182,9 @@ export const Title = styled(Date)`
background: ${colors.GRAY6};
}
`

const StyledLink = styled.a`
color: ${colors.GRAY6};
font-size: 16px;
height: 16px;
`
4 changes: 3 additions & 1 deletion src/components/App/SideBar/Relevance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const Relevance = ({ isSearchResult }: Props) => {
show_title: showTitle,
node_type: nodeType,
text,
link,
name,
profile_picture: profilePicture,
verified = false,
Expand All @@ -81,13 +82,14 @@ export const Relevance = ({ isSearchResult }: Props) => {
episodeTitle={formatDescription(episodeTitle)}
id={id}
imageUrl={imageUrl || ''}
link={link}
name={name || ''}
onClick={() => handleNodeClick(n)}
profilePicture={profilePicture}
showTitle={formatDescription(showTitle)}
text={text || ''}
twitterHandle={twitterHandle}
type={type || nodeType}
type={nodeType || type}
verified={verified}
/>
)
Expand Down
Loading

0 comments on commit bf09e2f

Please sign in to comment.