Skip to content

Commit

Permalink
@apps / @packages (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiracleHorizon authored Jan 2, 2025
1 parent 4849fec commit 08e861f
Show file tree
Hide file tree
Showing 936 changed files with 177 additions and 598 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install commitlint
run: |
pnpm add conventional-changelog-conventionalcommits -w
pnpm add commitlint@latest -w
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
# - name: Install commitlint
# run: |
# pnpm add conventional-changelog-conventionalcommits -w
# pnpm add commitlint@latest -w
#
# - name: Validate current commit (last commit) with commitlint
# if: github.event_name == 'push'
# run: npx commitlint --last --verbose
#
# - name: Validate PR commits with commitlint
# if: github.event_name == 'pull_request'
# run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

- name: Install Turborepo
run: pnpm add turbo --global
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions @apps/frontend/src/api/permissions-query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { createApiURL } from '@site/config'
import { FetchException } from './exceptions/FetchException'
import { useEffect, useState } from 'react'

export const usePermissionsQuery = () => {
const [permissions, setPermissions] = useState<Set<string>>(new Set([]))

useEffect(() => {
try {
const url = createApiURL('permissions/all?environment=development')
fetch(url).then(async response => {
if (response.ok) {
const permissionsJSON = await response.json()
setPermissions(new Set(permissionsJSON))
}
})
} catch (err) {
console.log(err)

throw new FetchException({
cause: err
})
}
}, [])

return permissions
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.button {
--size: 20px;

width: var(--size);
height: var(--size);
}
22 changes: 22 additions & 0 deletions @apps/frontend/src/components/ButtonGithub/ButtonGithub.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// import { ButtonGithub } from './ButtonGithub'
//
// describe('@components/ButtonGithub - rendering', () => {
// it('should render correctly', () => {
// cy.mount(<ButtonGithub />)
// })
//
// it('should render tooltip', () => {
// cy.mount(<ButtonGithub />)
// cy.get('[data-cy="button-github"]').should(
// 'have.attr',
// 'aria-label',
// 'Watch the project on GitHub'
// )
// })
// })

describe('@components/ButtonGithub - rendering', () => {
it('should render correctly', () => {
console.log(123)
})
})
25 changes: 25 additions & 0 deletions @apps/frontend/src/components/ButtonGithub/ButtonGithub.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { IconButton, Tooltip } from '@radix-ui/themes'

import { GithubLogoIcon } from '@scissors/react-icons/GithubLogoIcon'

import { GITHUB_REPO_PATH } from '@site/config'
import styles from './ButtonGithub.module.css'

export const tooltipContent = 'Watch the project on GitHub'

export const ButtonGithub = () => (
<Tooltip content={tooltipContent}>
<IconButton
asChild
radius='large'
color='gray'
variant='ghost'
className={styles.button}
data-cy='button-github'
>
<a target='_blank' rel='noreferrer' href={GITHUB_REPO_PATH}>
<GithubLogoIcon width='16px' height='16px' />
</a>
</IconButton>
</Tooltip>
)
1 change: 1 addition & 0 deletions @apps/frontend/src/components/ButtonGithub/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ButtonGithub } from './ButtonGithub'
File renamed without changes.
Loading

0 comments on commit 08e861f

Please sign in to comment.