Skip to content

Commit

Permalink
fix: rename package name
Browse files Browse the repository at this point in the history
  • Loading branch information
marsidev committed Oct 17, 2022
1 parent d6ebc80 commit 348ad9d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ https://react-turnstile.vercel.app/

## Install
1. First, [follow these steps](https://developers.cloudflare.com/turnstile/get-started/) to obtain a free site key and secret key from Cloudflare.
2. Install `react.turnstile` into your React application.
2. Install `@marsidev/react-turnstile` into your React application.

```bash
# Whichever matches your package manager
pnpm add react.turnstile
npm install react.turnstile
yarn add react.turnstile
pnpm add @marsidev/react-turnstile
npm install @marsidev/react-turnstile
yarn add @marsidev/react-turnstile
```

## Usage

The only required prop is the `siteKey`.

```jsx
import { Turnstile } from 'react.turnstile'
import { Turnstile } from '@marsidev/react-turnstile'

function TurnstileWidget() {
function Widget() {
return <Turnstile siteKey='1x00000000000000000000AA' />
}
```
Expand Down Expand Up @@ -81,18 +81,18 @@ function TurnstileWidget() {

### Rendering the widget:
```jsx
import { Turnstile } from 'react.turnstile'
import { Turnstile } from '@marsidev/react-turnstile'

function TurnstileWidget() {
function Widget() {
return <Turnstile siteKey='1x00000000000000000000AA' />
}
```

### Rendering the widget with custom props:
```jsx
import { Turnstile } from 'react.turnstile'
import { Turnstile } from '@marsidev/react-turnstile'

function TurnstileWidget() {
function Widget() {
return (
<Turnstile
siteKey='1x00000000000000000000AA'
Expand All @@ -112,9 +112,9 @@ function TurnstileWidget() {
### Managing widget rendering status:
```jsx
import { useState } from 'react'
import { Turnstile } from 'react.turnstile'
import { Turnstile } from '@marsidev/react-turnstile'

function TurnstileWidget() {
function Widget() {
const [status, setStatus] = useState()

return (
Expand All @@ -131,9 +131,9 @@ function TurnstileWidget() {
### Getting the token after solving the challenge:
```jsx
import { useState } from 'react'
import { Turnstile } from 'react.turnstile'
import { Turnstile } from '@marsidev/react-turnstile'

function TurnstileWidget() {
function Widget() {
const [token, setToken] = useState()

return (
Expand All @@ -148,9 +148,9 @@ function TurnstileWidget() {
### Interacting with the widget:
```jsx
import { useRef } from 'react'
import { Turnstile } from 'react.turnstile'
import { Turnstile } from '@marsidev/react-turnstile'

function TurnstileWidget() {
function Widget() {
const ref = useRef(null)

return (
Expand Down Expand Up @@ -180,9 +180,9 @@ function TurnstileWidget() {
### Interacting with the widget (using TypeScript):
```jsx
import { useRef } from 'react'
import { Turnstile, type TurnstileInstance } from 'react.turnstile'
import { Turnstile, type TurnstileInstance } from '@marsidev/react-turnstile'

function TurnstileWidget() {
function Widget() {
const ref = useRef<TurnstileInstance>(null)

return (
Expand All @@ -201,7 +201,7 @@ function TurnstileWidget() {
```jsx
// LoginForm.jsx
import { useRef, useState } from 'react'
import { Turnstile } from 'react.turnstile'
import { Turnstile } from '@marsidev/react-turnstile'

export default function LoginForm() {
const formRef = useRef(null)
Expand Down Expand Up @@ -295,15 +295,15 @@ Published under the [MIT License](./LICENCE).
<!-- Badges -->
[npm-version-src]: https://badgen.net/npm/v/react.turnstile?style=flat-square
[npm-version-href]: https://npm.im/react.turnstile
[npm-downloads-src]: https://badgen.net/npm/dm/react.turnstile?style=flat-square
[npm-downloads-href]: https://npm.im/react.turnstile
[npm-version-src]: https://badgen.net/npm/v/@marsidev/react-turnstile?style=flat-square
[npm-version-href]: https://npm.im/@marsidev/react-turnstile
[npm-downloads-src]: https://badgen.net/npm/dm/@marsidev/react-turnstile?style=flat-square
[npm-downloads-href]: https://npm.im/@marsidev/react-turnstile
<!-- [github-actions-src]: https://img.shields.io/github/workflow/status/danielroe/nuxt-turnstile/ci/main?style=flat-square -->
<!-- [github-actions-href]: https://github.com/danielroe/nuxt-turnstile/actions?query=workflow%3Aci -->
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/danielroe/nuxt-turnstile/main?style=flat-square -->
<!-- [codecov-href]: https://codecov.io/gh/danielroe/nuxt-turnstile -->
[packagephobia-src]: https://packagephobia.com/badge?p=react.turnstile
[packagephobia-href]: https://packagephobia.com/result?p=react.turnstile
[packagephobia-src]: https://packagephobia.com/badge?p=@marsidev/react-turnstile
[packagephobia-href]: https://packagephobia.com/result?p=@marsidev/react-turnstile
[prs-src]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[tests-src]: https://img.shields.io/badge/Tests-missing-red.svg?style=flat-square
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react.turnstile",
"name": "@marsidev/react-turnstile",
"version": "0.0.1",
"packageManager": "pnpm@7.12.1",
"description": "Cloudflare Turnstile integration for React.",
Expand Down
2 changes: 1 addition & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"next": "12.3.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react.turnstile": "workspace:*"
"@marsidev/react-turnstile": "workspace:*"
},
"devDependencies": {
"@types/node": "18.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/components/Demo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react'
import { Turnstile, type TurnstileInstance } from 'react.turnstile'
import { Turnstile, type TurnstileInstance } from '@marsidev/react-turnstile'
import ConfigForm from './ConfigForm'
import StateLabels from './StateLabels'
import WidgetMethods from './WidgetMethods'
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Footer = () => {
return (
<footer className='text-white flex items-center flex-col'>
<div>
<code>react.turnstile</code> source code{' '}
<code>react-turnstile</code> source code{' '}
<Link href='https://github.com/marsidev/react.turnstile' label='here' />
</div>

Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/components/WidgetMethods.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TurnstileInstance } from 'react.turnstile'
import type { TurnstileInstance } from '@marsidev/react-turnstile'

interface StateLabelsProps {
turnstile: React.MutableRefObject<TurnstileInstance | null>
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 348ad9d

@vercel
Copy link

@vercel vercel bot commented on 348ad9d Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-turnstile – ./

react-turnstile.vercel.app
react-turnstile-marsi.vercel.app
react-turnstile-git-main-marsi.vercel.app

Please sign in to comment.