Skip to content

Commit

Permalink
chore: update text
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryQW committed Oct 19, 2023
1 parent 0c527c1 commit b0c2ae0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 39 deletions.
6 changes: 3 additions & 3 deletions packages/site/src/components/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const ConnectButton = (props: ComponentProps<typeof Button>) => {
return (
<Button {...props}>
<FlaskFox />
<ButtonText>Connect</ButtonText>
<ButtonText>Install</ButtonText>
</Button>
);
};
Expand All @@ -89,13 +89,13 @@ export const ReconnectButton = (props: ComponentProps<typeof Button>) => {
return (
<Button {...props}>
<FlaskFox />
<ButtonText>Reconnect</ButtonText>
<ButtonText>Reinstall</ButtonText>
</Button>
);
};

export const SendHelloButton = (props: ComponentProps<typeof Button>) => {
return <Button {...props}>Send message</Button>;
return <Button {...props}>Trigger Now</Button>;
};

export const HeaderButtons = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const Header = ({
<HeaderWrapper>
<LogoWrapper>
<SnapLogo color={theme.colors.icon.default} size={36} />
<Title>RSS3-Cron</Title>
<Title>RSS3 Activity Monitor Snap</Title>
</LogoWrapper>
<RightContainer>
<Toggle
Expand Down
84 changes: 55 additions & 29 deletions packages/site/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ const Heading = styled.h1`
text-align: center;
`;

const SubHeading = styled.h2`
margin-top: 0;
margin-bottom: 2.4rem;
line-height: 1.8;
font-size: 2rem;
text-align: left;
max-width: 128rem;
`;

const Span = styled.span`
color: ${(props) => props.theme.colors.primary.default};
`;
Expand Down Expand Up @@ -183,9 +192,12 @@ const Index = () => {
try {
const resp = await addOwnWalletAddress();
if (resp && (resp as string[]).length > 0) {
await showAlert('added', JSON.stringify(resp, null, 2));
await showAlert('Monitored', JSON.stringify(resp, null, 2));
} else {
await showAlert('added', 'your wallet address is already added.');
await showAlert(
'Already Monitored',
'the wallet address is already monitored.',
);
}
} catch (e) {
console.error(e);
Expand All @@ -210,8 +222,8 @@ const Index = () => {

if (isAlreadyAdded) {
await showAlert(
'already added',
`your wallet address:[${walletAddress}] is already added.`,
'Already Monitored',
`The wallet address: ${walletAddress} is already monitored.`,
);
return;
}
Expand All @@ -227,8 +239,8 @@ const Index = () => {
]);

await showAlert(
'added',
`your wallet address:[${walletAddress}] is added.`,
'Succeeded',
`The wallet address: ${walletAddress} is being monitored.`,
);
} catch (e) {
console.error(e);
Expand All @@ -247,8 +259,8 @@ const Index = () => {
const resp = await sendClearState();
if (resp) {
await showAlert(
'Clear state success',
'You can choose to add a new address or use a suffix supported by RSS3 for monitoring.',
'Clear Succeeded',
'Start adding some new addresses now!',
);
}
} catch (e) {
Expand Down Expand Up @@ -278,8 +290,16 @@ const Index = () => {
return (
<Container>
<Heading>
Welcome to <Span>RSS3 Cron</Span>
Welcome to <Span>RSS3 Activity Monitor Snap</Span>
</Heading>
<SubHeading>
This Snap for <Span>MetaMask</Span> allows you to monitor the activities
of any address. <br></br>
1. Connect to the Snap and install. <br></br>
2. Start monitoring any address. <br></br>
3. When there is a new activity produced by any of your monitored
addresses, <Span>you will be notified</Span>.
</SubHeading>
<CardContainer>
{state.error && (
<ErrorMessage>
Expand All @@ -300,9 +320,8 @@ const Index = () => {
{!state.installedSnap && (
<Card
content={{
title: 'Connect',
description:
'Get started by connecting to and installing the example snap.',
title: 'Install',
description: 'Get started by installing this snap.',
button: (
<ConnectButton
onClick={handleConnectClick}
Expand All @@ -316,9 +335,9 @@ const Index = () => {
{shouldDisplayReconnectButton(state.installedSnap) && (
<Card
content={{
title: 'Reconnect',
title: 'Reinstall',
description:
'While connected to a local running snap this button will always be displayed in order to update the snap if a change is made.',
"Reinstall to update the snap, or if something isn't right.",
button: (
<ReconnectButton
onClick={handleConnectClick}
Expand All @@ -332,8 +351,9 @@ const Index = () => {

<Card
content={{
title: 'Send clean state',
description: 'Clean all data in MetaMask.',
title: 'Reset Snap State',
description:
'Clean all the data saved in this Snap. This does not affect your wallet in anyway.',
button: (
<SendHelloButton
onClick={handleSendClearStateClick}
Expand All @@ -349,7 +369,7 @@ const Index = () => {
}
/>

<Card
{/* <Card
content={{
title: 'Send Get State',
description:
Expand All @@ -367,12 +387,12 @@ const Index = () => {
Boolean(state.installedSnap) &&
!shouldDisplayReconnectButton(state.installedSnap)
}
/>
/> */}

<Card
{/* <Card
content={{
title: 'Add Your wallet',
description: 'Auto add your wallet addresses to monitor.',
description: 'Monitor your current wallet address.',
button: (
<SendHelloButton
onClick={handleSendAddYourWalletClick}
Expand All @@ -386,12 +406,12 @@ const Index = () => {
Boolean(state.installedSnap) &&
!shouldDisplayReconnectButton(state.installedSnap)
}
/>
/> */}

<Card
content={{
title: 'Show last updated',
description: 'Show the last updated activities.',
title: 'Show Last Updated',
description: 'Show the activities included in the last updated',
button: (
<SendHelloButton
onClick={handleShowLastUpdatedClick}
Expand All @@ -409,8 +429,9 @@ const Index = () => {

<Card
content={{
title: 'show all activities',
description: 'Show all activities.',
title: 'Show All Activities',
description:
'View all activities from all the addresses monitored.',
button: (
<SendHelloButton
onClick={handleShowAllActivitiesClick}
Expand All @@ -428,18 +449,23 @@ const Index = () => {

<Card
content={{
title: 'Add Wallet Address',
title: 'Monitor Any Address',
description: (
<>
<p>Add Wallet Address or Namespace to monitor</p>
<p>Supported NS list: ${supportedNSList.join(', ')}</p>
<p>Start monitoring a new address.</p>
<p>
Supported Web3 Name Service: {supportedNSList.join(', ')}.
</p>
<p>
And of course, your favorite and easy-to-memorize 0x address.
</p>
</>
),
button: (
<WalletAddressContainer>
<WalletAddressInput
type="text"
placeholder="wallet address"
placeholder="someone.eth, or 0x..."
onChange={(e) => setWalletAddress(e.target.value)}
/>
<Button
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "0.1.0",
"description": "Get notifications when monitored addresses produce new activities.",
"proposedName": "Address Activity Monitor",
"proposedName": "Activity Monitor",
"repository": {
"type": "git",
"url": "https://github.com/NaturalSelectionLabs/RSS3-MetaMask-Snap.git"
},
"source": {
"shasum": "yB7TZjvVi85bqWX2la6Fh0TEymGhoQzwANq5+1cos4Q=",
"shasum": "XHExyM2bxV7WjC+2oje3cdBj8mYPDUVzqQ2CBmgB6uk=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/snap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => {
const state = await getState();
const content: any = [heading('Last Updated')];
state.lastUpdatedActivities.forEach((activity) => {
content.push(heading(`${activity.address} has new feed`));
content.push(heading(`${activity.address}`));
activity.activities.forEach((item) => {
content.push(text(item.text));
content.push(divider());
Expand All @@ -95,7 +95,7 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => {
const state = await getState();
const content: any = [heading('All Activities')];
state.socialActivities.forEach((activity) => {
content.push(heading(`${activity.address} has new feed`));
content.push(heading(`${activity.address}`));
activity.activities.forEach((item) => {
content.push(text(item.text));
content.push(divider());
Expand Down Expand Up @@ -247,7 +247,7 @@ export const onCronjob: OnCronjobHandler = async ({ request }) => {
total: diffActivities.length,
});

content.push(heading(`${activity.address} has new feed`));
content.push(heading(`${activity.address}`));
diffActivities.forEach((item) => {
content.push(text(item.text));
content.push(divider());
Expand Down Expand Up @@ -333,7 +333,7 @@ export const onCronjob: OnCronjobHandler = async ({ request }) => {
total: diffActivities.length,
});

content.push(heading(`${activity.address} has new feed`));
content.push(heading(`${activity.address}`));
diffActivities.forEach((item) => {
content.push(text(item.text));
content.push(divider());
Expand Down

0 comments on commit b0c2ae0

Please sign in to comment.