Skip to content

Commit

Permalink
Merge pull request #388 from shubh73/fix/ui-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pvinis authored Aug 9, 2024
2 parents 06f61c3 + 5b99326 commit c63ac98
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 52 deletions.
10 changes: 6 additions & 4 deletions src/components/common/AlignDepsAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ const AlignDepsAlert = () => (
@rnx-kit/align-deps --requirements react-native@[major.minor]`.
</Markdown>
<br />
<br />
<Markdown>
`align-deps` is an OSS tool from Microsoft that automates dependency
management. It knows which packages\* versions are compatible with your
specific version of RN, and it uses that knowledge to align dependencies,
keeping your app healthy and up-to-date\*\*. [Find out more
[`align-deps`](https://microsoft.github.io/rnx-kit/docs/tools/align-deps)
is an OSS tool from Microsoft that automates dependency management. It
knows which packages\* versions are compatible with your specific version
of RN, and it uses that knowledge to align dependencies, keeping your app
healthy and up-to-date\*\*. [Find out more
here](https://microsoft.github.io/rnx-kit/docs/guides/dependency-management).
</Markdown>
<br />
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Diff/Diff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { ChangeEventArgs } from 'react-diff-view'
import type { DefaultRenderToken } from 'react-diff-view/types/context'

const copyPathPopoverContentOpts = {
default: 'Click to copy file path',
default: 'Copy file path',
copied: 'File path copied!',
}

Expand Down
50 changes: 33 additions & 17 deletions src/components/common/Diff/DiffHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,18 @@ interface CompleteDiffButtonProps extends ButtonProps {
}

const CompleteDiffButton = styled(
({ open, onClick, ...props }: CompleteDiffButtonProps) =>
open ? (
<Button {...props} icon={<RollbackOutlined />} onClick={onClick} />
) : (
<Button {...props} icon={<CheckOutlined />} onClick={onClick} />
)
({ open, onClick, ...props }: CompleteDiffButtonProps) => (
<Popover
content={open ? 'Mark as not viewed' : 'Mark as viewed'}
trigger="hover"
>
{open ? (
<Button {...props} icon={<RollbackOutlined />} onClick={onClick} />
) : (
<Button {...props} icon={<CheckOutlined />} onClick={onClick} />
)}
</Popover>
)
)`
${defaultIconButtonStyle}
&,
Expand Down Expand Up @@ -171,7 +177,7 @@ const CopyPathToClipboardButton = styled(
content={copyPathPopoverContent}
trigger="hover"
overlayStyle={{
width: '175px',
width: '140px',
textAlign: 'center',
}}
>
Expand All @@ -188,7 +194,7 @@ const CopyPathToClipboardButton = styled(
`

const copyAnchorLinks = {
default: 'Click to copy anchor link',
default: 'Copy anchor link',
copied: 'Anchor link copied!',
}

Expand All @@ -199,6 +205,7 @@ interface CopyAnchorLinksToClipboardButtonProps
toVersion: string
type: string
}

const CopyAnchorLinksToClipboardButton = styled(
({
id,
Expand Down Expand Up @@ -226,7 +233,7 @@ const CopyAnchorLinksToClipboardButton = styled(
content={content}
trigger="hover"
overlayStyle={{
width: '175px',
width: '150px',
textAlign: 'center',
}}
>
Expand All @@ -244,12 +251,17 @@ const CopyAnchorLinksToClipboardButton = styled(
`

const CollapseClickableArea = styled.div`
display: inline-block;
display: inline-flex;
align-items: center;
&:hover {
cursor: pointer;
}
`
& > *:last-child {
margin-left: 8px;
}
`
interface CollapseDiffButtonProps extends ButtonProps {
open: boolean
isDiffCollapsed: boolean
Expand All @@ -258,10 +270,15 @@ interface CollapseDiffButtonProps extends ButtonProps {

const CollapseDiffButton = styled(
({ open, isDiffCollapsed, ...props }: CollapseDiffButtonProps) =>
open ? <Button {...props} type="link" icon={<DownOutlined />} /> : null
open ? (
<Button
{...props}
type="link"
icon={<DownOutlined style={{ height: 12, width: 12 }} />}
/>
) : null
)`
color: ${({ theme }) => theme.text};
margin-right: 2px;
font-size: 10px;
transform: ${({ isDiffCollapsed }) =>
isDiffCollapsed ? 'rotate(-90deg)' : 'initial'};
Expand Down Expand Up @@ -343,7 +360,7 @@ const DiffHeader = ({
oldPath={sanitizedFilePaths.oldPath}
newPath={sanitizedFilePaths.newPath}
type={type}
/>{' '}
/>
<FileStatus type={type} />
<BinaryBadge open={!hasDiff} />
</CollapseClickableArea>
Expand All @@ -354,14 +371,13 @@ const DiffHeader = ({
onCopy={onCopyPathToClipboard}
copyPathPopoverContent={copyPathPopoverContent}
resetCopyPathPopoverContent={resetCopyPathPopoverContent}
/>
/>{' '}
<CopyAnchorLinksToClipboardButton
id={id}
type={type}
fromVersion={fromVersion}
toVersion={toVersion}
/>

<DiffCommentReminder
comments={diffComments}
isDiffCollapsed={isDiffCollapsed}
Expand All @@ -388,7 +404,7 @@ const DiffHeader = ({
version={toVersion}
path={newPath}
packageName={packageName}
/>
/>{' '}
<CompleteDiffButton
open={isDiffCompleted}
onClick={() => onCompleteDiff(diffKey)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/UpgradeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Container = styled.div`
`

const Button = styled(AntdButton)`
border-radius: 3px;
border-radius: 5px;
`

interface UpgradeButtonProps extends React.PropsWithRef<ButtonProps> {
Expand Down
4 changes: 0 additions & 4 deletions src/components/common/UpgradeSupportAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ const UpgradeSupportAlert = styled((props: UpgradeSupportAlertProps) => (
))`
span > a {
color: ${({ theme }) => theme.link}};
&:hover {
color: ${({ theme }) => theme.linkHover}};
}
}
`

Expand Down
8 changes: 7 additions & 1 deletion src/components/common/UsefulContentSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ const HideContentButton = styled(
<Button
{...props}
type="link"
icon={isContentOpen ? <UpOutlined /> : <DownOutlined />}
icon={
isContentOpen ? (
<UpOutlined style={{ height: 14, width: 14 }} />
) : (
<DownOutlined style={{ height: 14, width: 14 }} />
)
}
onClick={toggleContentVisibility}
/>
)
Expand Down
16 changes: 3 additions & 13 deletions src/components/common/VersionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,14 @@ export const testIDs = {
const Selectors = styled.div`
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 15px;
gap: 16px;
@media ${deviceSizes.tablet} {
flex-direction: row;
gap: 0;
}
`

const FromVersionSelector = styled(Select)`
@media ${deviceSizes.tablet} {
padding-right: 5px;
}
`
const FromVersionSelector = styled(Select)``

interface ToVersionSelectorProps extends SelectProps {
popover?: React.ReactNode
Expand All @@ -47,11 +41,7 @@ const ToVersionSelector = styled(
) : (
<Select {...props} />
)
)`
@media ${deviceSizes.tablet} {
padding-left: 5px;
}
`
)``

const getVersionsInURL = (): {
fromVersion: string
Expand Down
12 changes: 1 addition & 11 deletions src/components/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,19 @@ const TitleContainer = styled.div`

const AppNameField = styled.div`
width: 100%;
@media ${deviceSizes.tablet} {
padding-right: 5px;
}
`

const AppPackageField = styled.div`
width: 100%;
@media ${deviceSizes.tablet} {
padding-left: 5px;
}
`

const AppDetailsContainer = styled.div`
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 15px;
gap: 16px;
@media ${deviceSizes.tablet} {
flex-direction: row;
gap: 0;
}
`

Expand Down

0 comments on commit c63ac98

Please sign in to comment.