Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react-ios-pwa-prompt-ts

Forked with care from [react-ios-pwa-prompt](https://github.com/chrisdancee/react-ios-pwa-prompt), this package is revamped using Vite, Styled Components, and TypeScript.
Forked with care from [react-ios-pwa-prompt](https://github.com/chrisdancee/react-ios-pwa-prompt), this package is revamped using Vite, Emotion, and TypeScript.

## Summary

Expand All @@ -20,7 +20,7 @@ A React component that provides a customizable Progressive Web App (PWA) prompt
- 📃 Customize prompt content based on PWA availability and full-screen mode.
- ⚡️ Efficient: Minimal overhead for non-iOS devices, optimizing each page load.
- 🌕 Dark mode support: Adapts to iOS 13 and 14 settings.
- 🎨 Supports custom styling with `styled-components`
- 🎨 Supports custom styling with `emotion` styled

## Usage

Expand All @@ -33,7 +33,8 @@ npm i react-ios-pwa-prompt-ts
2. Add peer dependencies if not already included in your application:

```
npm i react styled-components
npm i @emotion/react && \
npm i @emotion/styled
```

3. Import into your project:
Expand Down
2 changes: 0 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import importPlugin from 'eslint-plugin-import';
import jsxA11Y from 'eslint-plugin-jsx-a11y';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import styledA11y from 'eslint-plugin-styled-components-a11y';
import testingLibrary from 'eslint-plugin-testing-library';
import globals from 'globals';
import tseslint from 'typescript-eslint';
Expand All @@ -14,7 +13,6 @@ export default [
js.configs.recommended,
importPlugin.flatConfigs.recommended,
jsxA11Y.flatConfigs.recommended,
styledA11y.flatConfigs.recommended,
testingLibrary.configs['flat/dom'],
...tseslint.configs.recommended,
...storybook.configs['flat/recommended'],
Expand Down
12 changes: 8 additions & 4 deletions lib/components/styled.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import styled from '@emotion/styled';
import { FaRegSquarePlus } from 'react-icons/fa6';
import { IoShareOutline } from 'react-icons/io5';
import { styled } from 'styled-components';

import type { IconBaseProps } from 'react-icons';

type PromptCopyProps = {
$bold?: boolean;
Expand All @@ -11,6 +13,10 @@ type VisibleElementProps = {
$transitionDuration?: number;
};

const IoShareOutlineViewBox = (props: IconBaseProps) => (
<IoShareOutline viewBox="55 0 512 512" {...props} />
);

export const PromptOverlay = styled.div<VisibleElementProps>`
background-color: rgba(10, 10, 10, 0.5);
display: ${({ $isVisible }) => ($isVisible ? 'block' : 'none')};
Expand Down Expand Up @@ -145,9 +151,7 @@ export const PromptDescription = styled.div`
}
`;

export const PromptShareIcon = styled(IoShareOutline).attrs({
viewBox: '55 0 512 512',
})`
export const PromptShareIcon = styled(IoShareOutlineViewBox)`
color: rgba(0, 85, 179, 1);
height: 44px;
margin-right: 15px;
Expand Down
Loading