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
72 changes: 72 additions & 0 deletions lib/web/screens/web_website_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,83 @@ class _WebWebsiteDetailScreenState extends State<WebWebsiteDetailScreen> {
),
],
),
const SizedBox(height: 14),
const Divider(height: 1),
const SizedBox(height: 12),
_ownDomainBlock(theme, pointer),
],
),
);
}

/// The IPFS address of the live site, for people pointing their own domain at
/// it (see `site/domain/` — https://files.fx.land/domain). The hash is
/// per-version: it changes every time the site is regenerated, so we label it
/// as "this version" and tell people to re-copy it after a regenerate.
Widget _ownDomainBlock(ThemeData theme, WebsiteGroupPointer pointer) {
final cid = pointer.currentCid;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Row(
children: [
Icon(LucideIcons.globe, size: 16, color: AppColors.primary),
SizedBox(width: 8),
Text('Use your own domain',
style: TextStyle(
fontWeight: FontWeight.w600, color: AppColors.primary)),
],
),
const SizedBox(height: 6),
Text(
cid == null
? 'The IPFS address appears here once your site finishes publishing.'
: 'Paste this IPFS address into Cloudflare to serve the site from '
'your own domain. It changes each time you regenerate — copy '
'it again after every update.',
style: theme.textTheme.bodySmall,
),
if (cid != null) ...[
const SizedBox(height: 8),
SelectableText(
cid,
style: const TextStyle(fontFamily: 'monospace', fontSize: 12),
),
const SizedBox(height: 8),
Wrap(
spacing: 8,
runSpacing: 8,
children: [
OutlinedButton.icon(
icon: const Icon(LucideIcons.copy, size: 14),
label: const Text('Copy IPFS hash'),
onPressed: () => _copyValue(cid, 'IPFS hash'),
),
OutlinedButton.icon(
icon: const Icon(LucideIcons.copy, size: 14),
label: const Text('Copy DNSLink value'),
onPressed: () => _copyValue('/ipfs/$cid', 'DNSLink value'),
),
TextButton.icon(
icon: const Icon(LucideIcons.externalLink, size: 14),
label: const Text('How to set it up'),
onPressed: () => launchUrl(
Uri.parse('https://files.fx.land/domain'),
webOnlyWindowName: '_blank'),
),
],
),
],
],
);
}

void _copyValue(String value, String label) {
Clipboard.setData(ClipboardData(text: value));
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text('$label copied to clipboard')));
}

Widget _assetsSection(ThemeData theme) {
final jobs = WebWebsiteAssetUploader.instance.jobsForTag(widget.tagId);
return Column(
Expand Down
Binary file added site/domain/img/cf-buy-branch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-connect-branch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-connect-your-domain.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-create-gateway-filled.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-dns-records.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-gateway-created.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-gateway-edit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-gateway-type.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-nameservers.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-redirect-rule.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-redirect-templates.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-register-checkout.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/domain/img/cf-web3-page.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
592 changes: 592 additions & 0 deletions site/domain/index.html

Large diffs are not rendered by default.